pub enum Opt {
Optional,
Essential,
}Expand description
Optionality of a path part.
For example, [] | .a fails with an error, while [] | .a? returns nothing.
By default, path parts are essential, meaning that they fail.
Annotating them with ? makes them optional.
Variants
Optional
Return nothing if the input cannot be accessed with the path
Essential
Fail if the input cannot be accessed with the path
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Opt
impl<'de> Deserialize<'de> for Opt
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Opt
Auto Trait Implementations
impl RefUnwindSafe for Opt
impl Send for Opt
impl Sync for Opt
impl Unpin for Opt
impl UnwindSafe for Opt
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more