pub enum Flavor {
Value,
List,
Map,
}Expand description
Flavor decides what type of value is assumed at the root of the document.
For example, List flavored smallish consists of the body of a list, without the enclosing braces.
let a: Vec<u8> = from_str(Flavor::Value, "[1, 2, 3]").unwrap();
let b: Vec<u8> = from_str(Flavor::List, "1, 2, 3").unwrap();
assert_eq!(a, b);The main purpose of this is to allow writing lists of enumerations as a plain, newline-separated list of values by using the List flavor.
Variants§
Value
Any value is expected at the root. Braces are required.
List
A list (without braces!) is expected at the root.
Map
A map (without braces!) is expected at the root.
Trait Implementations§
impl Copy for Flavor
impl Eq for Flavor
impl StructuralPartialEq for Flavor
Auto Trait Implementations§
impl Freeze for Flavor
impl RefUnwindSafe for Flavor
impl Send for Flavor
impl Sync for Flavor
impl Unpin for Flavor
impl UnsafeUnpin for Flavor
impl UnwindSafe for Flavor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more