pub struct GetOptions<'a> {
    pub path: VariantPath<'a>,
    pub as_type: Option<FieldRef>,
    pub cast_options: CastOptions<'a>,
}Expand description
Controls the action of the variant_get kernel.
Fields§
§path: VariantPath<'a>What path to extract
as_type: Option<FieldRef>if as_type is None, the returned array will itself be a VariantArray.
if as_type is Some(type) the field is returned as the specified type.
cast_options: CastOptions<'a>Controls the casting behavior (e.g. error vs substituting null on cast error).
Implementations§
Source§impl<'a> GetOptions<'a>
 
impl<'a> GetOptions<'a>
Sourcepub fn new_with_path(path: VariantPath<'a>) -> Self
 
pub fn new_with_path(path: VariantPath<'a>) -> Self
Construct options to get the specified path as a variant.
Sourcepub fn with_as_type(self, as_type: Option<FieldRef>) -> Self
 
pub fn with_as_type(self, as_type: Option<FieldRef>) -> Self
Specify the type to return.
Sourcepub fn with_cast_options(self, cast_options: CastOptions<'a>) -> Self
 
pub fn with_cast_options(self, cast_options: CastOptions<'a>) -> Self
Specify the cast options to use when casting to the specified type.
Trait Implementations§
Source§impl<'a> Clone for GetOptions<'a>
 
impl<'a> Clone for GetOptions<'a>
Source§fn clone(&self) -> GetOptions<'a>
 
fn clone(&self) -> GetOptions<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl<'a> Debug for GetOptions<'a>
 
impl<'a> Debug for GetOptions<'a>
Source§impl<'a> Default for GetOptions<'a>
 
impl<'a> Default for GetOptions<'a>
Source§fn default() -> GetOptions<'a>
 
fn default() -> GetOptions<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for GetOptions<'a>
impl<'a> RefUnwindSafe for GetOptions<'a>
impl<'a> Send for GetOptions<'a>
impl<'a> Sync for GetOptions<'a>
impl<'a> Unpin for GetOptions<'a>
impl<'a> UnwindSafe for GetOptions<'a>
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