Struct GetOptions
pub struct GetOptions<'a> {
pub path: VariantPath<'a>,
pub as_type: Option<Arc<Field>>,
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<Arc<Field>>
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§
§impl<'a> GetOptions<'a>
impl<'a> GetOptions<'a>
pub fn new() -> GetOptions<'a>
pub fn new() -> GetOptions<'a>
Construct default options to get the specified path as a variant.
pub fn new_with_path(path: VariantPath<'a>) -> GetOptions<'a>
pub fn new_with_path(path: VariantPath<'a>) -> GetOptions<'a>
Construct options to get the specified path as a variant.
pub fn with_as_type(self, as_type: Option<Arc<Field>>) -> GetOptions<'a>
pub fn with_as_type(self, as_type: Option<Arc<Field>>) -> GetOptions<'a>
Specify the type to return.
pub fn with_cast_options(self, cast_options: CastOptions<'a>) -> GetOptions<'a>
pub fn with_cast_options(self, cast_options: CastOptions<'a>) -> GetOptions<'a>
Specify the cast options to use when casting to the specified type.
Trait Implementations§
§impl<'a> Clone for GetOptions<'a>
impl<'a> Clone for GetOptions<'a>
§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 more§impl<'a> Debug for GetOptions<'a>
impl<'a> Debug for GetOptions<'a>
§impl<'a> Default for GetOptions<'a>
impl<'a> Default for GetOptions<'a>
§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more