pub struct VariantField<V, F> {
pub variant: V,
pub field: F,
}
Expand description
This allows accessing the F
field inside the V
enum variant.
This is the type that fp!(::Foo.bar)
constructs.
Both the V
and F
type parameters are TStr.
§Construction
You can construct this using (not an exhaustive list):
-
The
fp
macro, withfp!(::Foo.bar)
-
The
VariantField{variant,field}
struct literal -
The
new
constructor. -
The
NEW
associated constant,if bothV
andF
implementcore_extensions::ConstDefault
(reexported instructural::reexports::ConstDefault
).
§Example
use structural::{StructuralExt, fp, ts};
use structural::for_examples::Variants;
use structural::path::VariantField;
let mut foo=Variants::Foo(3,5);
assert_eq!( foo.field_(fp!(::Foo.0)), Some(&3) );
assert_eq!( foo.field_(fp!(::Foo.1)), Some(&5) );
assert_eq!( foo.field_(fp!(::Boom.a)), None );
assert_eq!( foo.field_(fp!(::Boom.b)), None );
assert_eq!( foo.field_(VariantField::new(ts!(Foo), ts!(0))), Some(&3) );
assert_eq!( foo.field_(VariantField::new(ts!(Foo), ts!(1))), Some(&5) );
assert_eq!( foo.field_(VariantField::new(ts!(Boom), ts!(a))), None );
assert_eq!( foo.field_(VariantField::new(ts!(Boom), ts!(b))), None );
assert_eq!( foo.field_mut(fp!(::Foo.0)), Some(&mut 3) );
assert_eq!( foo.field_mut(fp!(::Foo.1)), Some(&mut 5) );
assert_eq!( foo.field_mut(fp!(::Boom.a)), None );
assert_eq!( foo.field_mut(fp!(::Boom.b)), None );
assert_eq!( foo.field_mut(VariantField::new(ts!(Foo), ts!(0))), Some(&mut 3) );
assert_eq!( foo.field_mut(VariantField::new(ts!(Foo), ts!(1))), Some(&mut 5) );
assert_eq!( foo.field_mut(VariantField::new(ts!(Boom), ts!(a))), None );
assert_eq!( foo.field_mut(VariantField::new(ts!(Boom), ts!(b))), None );
Fields§
§variant: V
The variant this accesses.
field: F
The field this accesses inside the variant.
Implementations§
Source§impl<V, F> VariantField<V, F>where
V: ConstDefault,
F: ConstDefault,
impl<V, F> VariantField<V, F>where
V: ConstDefault,
F: ConstDefault,
Source§impl<V, F> VariantField<V, F>
impl<V, F> VariantField<V, F>
Sourcepub const fn into_path(self) -> NestedFieldPath<(Self,)>
pub const fn into_path(self) -> NestedFieldPath<(Self,)>
Constructs a NestedFieldPath from this.
Sourcepub const fn into_set(self) -> FieldPathSet<(Self,), UniquePaths>
pub const fn into_set(self) -> FieldPathSet<(Self,), UniquePaths>
Constructs a FieldPathSet from this.
Source§impl<V, F> VariantField<V, F>
impl<V, F> VariantField<V, F>
Sourcepub const fn new(variant: V, field: F) -> Self
pub const fn new(variant: V, field: F) -> Self
Constructs a VariantField from the name of the variant,and field.
Both name
and field
is expected to be a ::structural::path::TStr.
Trait Implementations§
Source§impl<V: Clone, F: Clone> Clone for VariantField<V, F>
impl<V: Clone, F: Clone> Clone for VariantField<V, F>
Source§fn clone(&self) -> VariantField<V, F>
fn clone(&self) -> VariantField<V, F>
Returns a copy 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<V, F> ConstDefault for VariantField<V, F>where
V: ConstDefault,
F: ConstDefault,
impl<V, F> ConstDefault for VariantField<V, F>where
V: ConstDefault,
F: ConstDefault,
Source§impl<T, U> Debug for VariantField<T, U>
impl<T, U> Debug for VariantField<T, U>
Source§impl<V, F> IsMultiFieldPath for VariantField<V, F>
impl<V, F> IsMultiFieldPath for VariantField<V, F>
Source§type PathUniqueness = UniquePaths
type PathUniqueness = UniquePaths
Whether the paths in the set can contain duplicate paths. Read more
Source§impl<V, F> Ord for VariantField<V, F>
impl<V, F> Ord for VariantField<V, F>
Source§impl<V, F> PartialEq for VariantField<V, F>
impl<V, F> PartialEq for VariantField<V, F>
Source§impl<V, F> PartialOrd for VariantField<V, F>
impl<V, F> PartialOrd for VariantField<V, F>
Source§impl<This, _V, _F> RevFieldErr<This> for VariantField<_V, _F>
impl<This, _V, _F> RevFieldErr<This> for VariantField<_V, _F>
Source§type Err = FailedAccess
type Err = FailedAccess
The error returned by
rev_*
methods. Read moreSource§impl<This, _V, _F> RevFieldType<This> for VariantField<_V, _F>
impl<This, _V, _F> RevFieldType<This> for VariantField<_V, _F>
Source§impl<'a, This, _V, _F> RevGetFieldImpl<'a, This> for VariantField<_V, _F>
impl<'a, This, _V, _F> RevGetFieldImpl<'a, This> for VariantField<_V, _F>
Source§fn rev_get_field(self, this: &'a This) -> Result<&'a This::Ty, FailedAccess>
fn rev_get_field(self, this: &'a This) -> Result<&'a This::Ty, FailedAccess>
Accesses the field that
self
represents inside of this
,by reference.Source§impl<'a, This, _V, _F> RevGetFieldMutImpl<'a, This> for VariantField<_V, _F>
impl<'a, This, _V, _F> RevGetFieldMutImpl<'a, This> for VariantField<_V, _F>
Source§fn rev_get_field_mut(
self,
this: &'a mut This,
) -> Result<&'a mut This::Ty, FailedAccess>
fn rev_get_field_mut( self, this: &'a mut This, ) -> Result<&'a mut This::Ty, FailedAccess>
Accesses the field that
self
represents inside of this
,by mutable reference.Source§unsafe fn rev_get_field_raw_mut(
self,
this: *mut This,
) -> Result<*mut This::Ty, FailedAccess>
unsafe fn rev_get_field_raw_mut( self, this: *mut This, ) -> Result<*mut This::Ty, FailedAccess>
Source§impl<'a, This, V, F> RevGetMultiFieldImpl<'a, This> for VariantField<V, F>where
Self: RevGetFieldImpl<'a, This>,
This: 'a + ?Sized,
RGFT<Self, This>: 'a,
Result<&'a RGFT<Self, This>, RGFE<Self, This>>: 'a + NormalizeFields,
impl<'a, This, V, F> RevGetMultiFieldImpl<'a, This> for VariantField<V, F>where
Self: RevGetFieldImpl<'a, This>,
This: 'a + ?Sized,
RGFT<Self, This>: 'a,
Result<&'a RGFT<Self, This>, RGFE<Self, This>>: 'a + NormalizeFields,
Source§type UnnormFields = (Result<&'a <VariantField<V, F> as RevFieldType<This>>::Ty, <VariantField<V, F> as RevFieldErr<This>>::Err>,)
type UnnormFields = (Result<&'a <VariantField<V, F> as RevFieldType<This>>::Ty, <VariantField<V, F> as RevFieldErr<This>>::Err>,)
A collection of
Results<&'a _,_>
s referencing fields.Source§impl<'a, This, V, F> RevGetMultiFieldMutImpl<'a, This> for VariantField<V, F>where
Self: RevGetFieldMutImpl<'a, This>,
This: 'a + ?Sized,
RGFT<Self, This>: 'a,
Result<&'a mut RGFT<Self, This>, RGFE<Self, This>>: NormalizeFields,
Result<*mut RGFT<Self, This>, RGFE<Self, This>>: NormalizeFields,
impl<'a, This, V, F> RevGetMultiFieldMutImpl<'a, This> for VariantField<V, F>where
Self: RevGetFieldMutImpl<'a, This>,
This: 'a + ?Sized,
RGFT<Self, This>: 'a,
Result<&'a mut RGFT<Self, This>, RGFE<Self, This>>: NormalizeFields,
Result<*mut RGFT<Self, This>, RGFE<Self, This>>: NormalizeFields,
Source§type UnnormFieldsMut = (Result<&'a mut <VariantField<V, F> as RevFieldType<This>>::Ty, <VariantField<V, F> as RevFieldErr<This>>::Err>,)
type UnnormFieldsMut = (Result<&'a mut <VariantField<V, F> as RevFieldType<This>>::Ty, <VariantField<V, F> as RevFieldErr<This>>::Err>,)
This is usually a tuple of
Result<&mut _,E: IsFieldErr>
s.Source§type UnnormFieldsRawMut = (Result<*mut <VariantField<V, F> as RevFieldType<This>>::Ty, <VariantField<V, F> as RevFieldErr<This>>::Err>,)
type UnnormFieldsRawMut = (Result<*mut <VariantField<V, F> as RevFieldType<This>>::Ty, <VariantField<V, F> as RevFieldErr<This>>::Err>,)
This is usually a tuple of
Result<*mut _,E: IsFieldErr>
s.Source§fn rev_get_multi_field_mut_impl(
self,
this: &'a mut This,
) -> (Result<&'a mut RGFT<Self, This>, RGFE<Self, This>>,)
fn rev_get_multi_field_mut_impl( self, this: &'a mut This, ) -> (Result<&'a mut RGFT<Self, This>, RGFE<Self, This>>,)
Gets mutable references to multiple fields from
this
,
usually a tuple of Result<&mut _,E: IsFieldErr>
s.Source§impl<This, _V, _F> RevIntoFieldImpl<This> for VariantField<_V, _F>where
This: ?Sized + IntoVariantField<_V, _F>,
impl<This, _V, _F> RevIntoFieldImpl<This> for VariantField<_V, _F>where
This: ?Sized + IntoVariantField<_V, _F>,
Source§fn rev_into_field(self, this: This) -> Result<This::Ty, FailedAccess>where
This: Sized,
fn rev_into_field(self, this: This) -> Result<This::Ty, FailedAccess>where
This: Sized,
Accesses the field that
self
represents inside of this
,by value.Source§impl<This, V, F> RevIntoMultiFieldImpl<This> for VariantField<V, F>where
Self: RevIntoFieldImpl<This>,
RGFT<Self, This>: Sized,
Result<RGFT<Self, This>, RGFE<Self, This>>: NormalizeFields,
impl<This, V, F> RevIntoMultiFieldImpl<This> for VariantField<V, F>where
Self: RevIntoFieldImpl<This>,
RGFT<Self, This>: Sized,
Result<RGFT<Self, This>, RGFE<Self, This>>: NormalizeFields,
Source§type UnnormIntoFields = (Result<<VariantField<V, F> as RevFieldType<This>>::Ty, <VariantField<V, F> as RevFieldErr<This>>::Err>,)
type UnnormIntoFields = (Result<<VariantField<V, F> as RevFieldType<This>>::Ty, <VariantField<V, F> as RevFieldErr<This>>::Err>,)
This is usually a tuple of
Result<_, E: IsFieldErr>
s.Source§impl<This, _V, _F> RevMoveOutFieldImpl<This> for VariantField<_V, _F>where
This: ?Sized + IntoVariantField<_V, _F>,
impl<This, _V, _F> RevMoveOutFieldImpl<This> for VariantField<_V, _F>where
This: ?Sized + IntoVariantField<_V, _F>,
Source§unsafe fn rev_move_out_field(
self,
this: &mut This,
moved: &mut MovedOutFields,
) -> Result<This::Ty, FailedAccess>
unsafe fn rev_move_out_field( self, this: &mut This, moved: &mut MovedOutFields, ) -> Result<This::Ty, FailedAccess>
impl<V: Copy, F: Copy> Copy for VariantField<V, F>
impl<V, F> Eq for VariantField<V, F>
impl<V, F> IsSingleFieldPath for VariantField<V, F>
impl<V, F> ShallowFieldPath for VariantField<V, F>
Auto Trait Implementations§
impl<V, F> Freeze for VariantField<V, F>
impl<V, F> RefUnwindSafe for VariantField<V, F>where
V: RefUnwindSafe,
F: RefUnwindSafe,
impl<V, F> Send for VariantField<V, F>
impl<V, F> Sync for VariantField<V, F>
impl<V, F> Unpin for VariantField<V, F>
impl<V, F> UnwindSafe for VariantField<V, F>where
V: UnwindSafe,
F: UnwindSafe,
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<This> EnumExt for Thiswhere
This: ?Sized,
impl<This> EnumExt for Thiswhere
This: ?Sized,
Source§fn as_variant<V>(
&self,
vari: TStr<V>,
) -> Result<&VariantProxy<Self, TStr<V>>, &Self>
fn as_variant<V>( &self, vari: TStr<V>, ) -> Result<&VariantProxy<Self, TStr<V>>, &Self>
Fallibly converts a reference to an enum into
a reference of a VariantProxy of some variant. Read more
Source§fn as_mut_variant<V>(
&mut self,
vari: TStr<V>,
) -> Result<&mut VariantProxy<Self, TStr<V>>, &mut Self>
fn as_mut_variant<V>( &mut self, vari: TStr<V>, ) -> Result<&mut VariantProxy<Self, TStr<V>>, &mut Self>
Fallibly converts a mutable reference to an enum into
a mutable reference of a VariantProxy of some variant. Read more
Source§impl<This, T> IntoStructural<T> for Thiswhere
T: FromStructural<This>,
impl<This, T> IntoStructural<T> for Thiswhere
T: FromStructural<This>,
Source§fn into_structural(self) -> T
fn into_structural(self) -> T
Performs the conversion
Source§impl<'a, This, Path> RevGetMultiField<'a, This> for Pathwhere
This: 'a + ?Sized,
Path: RevGetMultiFieldImpl<'a, This>,
impl<'a, This, Path> RevGetMultiField<'a, This> for Pathwhere
This: 'a + ?Sized,
Path: RevGetMultiFieldImpl<'a, This>,
Source§type Fields = <<Path as RevGetMultiFieldImpl<'a, This>>::UnnormFields as NormalizeFields>::Output
type Fields = <<Path as RevGetMultiFieldImpl<'a, This>>::UnnormFields as NormalizeFields>::Output
This is usually a tuple of
Option<&_>
s and &_
s.Source§fn rev_get_multi_field(
self,
this: &'a This,
) -> <Path as RevGetMultiField<'a, This>>::Fields
fn rev_get_multi_field( self, this: &'a This, ) -> <Path as RevGetMultiField<'a, This>>::Fields
Gets references to multiple fields from
this
,
usually a tuple of Option<&_>
s and &_
s.Source§impl<'a, This, Path> RevGetMultiFieldMut<'a, This> for Pathwhere
This: 'a + ?Sized,
Path: RevGetMultiFieldMutImpl<'a, This>,
impl<'a, This, Path> RevGetMultiFieldMut<'a, This> for Pathwhere
This: 'a + ?Sized,
Path: RevGetMultiFieldMutImpl<'a, This>,
Source§type FieldsMut = <<Path as RevGetMultiFieldMutImpl<'a, This>>::UnnormFieldsMut as NormalizeFields>::Output
type FieldsMut = <<Path as RevGetMultiFieldMutImpl<'a, This>>::UnnormFieldsMut as NormalizeFields>::Output
This is usually a tuple of
Option<&mut _>
s and &mut _
s.Source§type FieldsRawMut = <<Path as RevGetMultiFieldMutImpl<'a, This>>::UnnormFieldsRawMut as NormalizeFields>::Output
type FieldsRawMut = <<Path as RevGetMultiFieldMutImpl<'a, This>>::UnnormFieldsRawMut as NormalizeFields>::Output
This is usually a tuple of
Option<*mut _>
s and *mut _
s.Source§fn rev_get_multi_field_mut(
self,
this: &'a mut This,
) -> <Path as RevGetMultiFieldMut<'a, This>>::FieldsMut
fn rev_get_multi_field_mut( self, this: &'a mut This, ) -> <Path as RevGetMultiFieldMut<'a, This>>::FieldsMut
Gets mutable references to multiple fields from
this
,
usually a tuple of Option<&mut _>
s and &mut _
s.Source§unsafe fn rev_get_multi_field_raw_mut(
self,
this: *mut This,
) -> <Path as RevGetMultiFieldMut<'a, This>>::FieldsRawMut
unsafe fn rev_get_multi_field_raw_mut( self, this: *mut This, ) -> <Path as RevGetMultiFieldMut<'a, This>>::FieldsRawMut
Gets raw pointers to multiple fields from
this
,
usually a tuple of Option<*mut _>
s and *mut _
s. Read moreSource§impl<This, Path> RevIntoMultiField<This> for Pathwhere
Path: RevIntoMultiFieldImpl<This>,
impl<This, Path> RevIntoMultiField<This> for Pathwhere
Path: RevIntoMultiFieldImpl<This>,
Source§type IntoFields = <<Path as RevIntoMultiFieldImpl<This>>::UnnormIntoFields as NormalizeFields>::Output
type IntoFields = <<Path as RevIntoMultiFieldImpl<This>>::UnnormIntoFields as NormalizeFields>::Output
This is usually a tuple of
Option<T>
s and T
s.Source§fn rev_into_multi_field(
self,
this: This,
) -> <Path as RevIntoMultiField<This>>::IntoFields
fn rev_into_multi_field( self, this: This, ) -> <Path as RevIntoMultiField<This>>::IntoFields
Converts
this
into multiple fields by value.
usually a tuple of Option<T>
s and T
s.Source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
Source§const T: PhantomData<fn() -> Self> = PhantomData
const T: PhantomData<fn() -> Self> = PhantomData
Represents Self by using a VariantPhantom,
using the syntax
Type::T
to pass it in methods with _:VariantPhantom<T>
parameters. Read moreSource§const T_D: PhantomData<Self> = PhantomData
const T_D: PhantomData<Self> = PhantomData
Represents Self by using a VariantDropPhantom,for specialized cases. Read more
Source§fn assert_ty(self, _other: PhantomData<fn() -> Self>) -> Selfwhere
Self: Sized,
fn assert_ty(self, _other: PhantomData<fn() -> Self>) -> Selfwhere
Self: Sized,
Asserts that
other
is the same type as self
.Source§fn assert_ty_ref(&self, _other: PhantomData<fn() -> Self>) -> &Selfwhere
Self: Sized,
fn assert_ty_ref(&self, _other: PhantomData<fn() -> Self>) -> &Selfwhere
Self: Sized,
Asserts that
other
is the same type as self
.Source§fn assert_ty_mut(&mut self, _other: PhantomData<fn() -> Self>) -> &mut Selfwhere
Self: Sized,
fn assert_ty_mut(&mut self, _other: PhantomData<fn() -> Self>) -> &mut Selfwhere
Self: Sized,
Asserts that
other
is the same type as self
.Source§fn ty_(&self) -> PhantomData<fn() -> Self>
fn ty_(&self) -> PhantomData<fn() -> Self>
Equivalent to SelfOps::T,as a method. Read more
Source§fn ty_inv(&self) -> PhantomData<fn(Self) -> Self>
fn ty_inv(&self) -> PhantomData<fn(Self) -> Self>
Equivalent to Self::ty_ with an invariant type.
Source§fn ty_inv_ref(&self) -> PhantomData<Cell<&Self>>
fn ty_inv_ref(&self) -> PhantomData<Cell<&Self>>
Equivalent to Self::ty_ with an invariant lifetime.
Source§fn eq_id(&self, other: &Self) -> bool
fn eq_id(&self, other: &Self) -> bool
Identity comparison to another value of the same type. Read more
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Emulates the pipeline operator,allowing method syntax in more places. Read more
Source§fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
The same as
piped
except that the function takes &Self
Useful for functions that take &Self
instead of Self
. Read moreSource§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
The same as
piped
except that the function takes &mut Self
.
Useful for functions that take &mut Self
instead of Self
.Source§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
Mutates self using a closure taking self by mutable reference,
passing it along the method chain. Read more
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Observes the value of self passing it along unmodified.
Useful in a long method chain. Read more
Source§fn into_<T>(self, _: PhantomData<fn() -> T>) -> Twhere
Self: Into<T>,
fn into_<T>(self, _: PhantomData<fn() -> T>) -> Twhere
Self: Into<T>,
Performs a conversion using Into. Read more
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
Performs a reference to reference conversion using AsRef,
using the turbofish
.as_ref_::<_>()
syntax. Read moreSource§impl<T> StructuralExt for Twhere
T: ?Sized,
impl<T> StructuralExt for Twhere
T: ?Sized,
Source§fn field_<'a, P>(
&'a self,
path: P,
) -> NormalizeFieldsOut<Result<&'a P::Ty, P::Err>>
fn field_<'a, P>( &'a self, path: P, ) -> NormalizeFieldsOut<Result<&'a P::Ty, P::Err>>
Gets a reference to a field,determined by
path
. Read moreSource§fn fields<'a, P>(&'a self, path: P) -> RevGetMultiFieldOut<'a, P, Self>where
P: RevGetMultiField<'a, Self>,
fn fields<'a, P>(&'a self, path: P) -> RevGetMultiFieldOut<'a, P, Self>where
P: RevGetMultiField<'a, Self>,
Gets references to multiple fields,determined by
path
. Read moreSource§fn cloned_fields<'a, P>(
&'a self,
path: P,
) -> ClonedOut<RevGetMultiFieldOut<'a, P, Self>>
fn cloned_fields<'a, P>( &'a self, path: P, ) -> ClonedOut<RevGetMultiFieldOut<'a, P, Self>>
Gets clones of multiple fields,determined by
path
. Read moreSource§fn field_mut<'a, P>(
&'a mut self,
path: P,
) -> NormalizeFieldsOut<Result<&'a mut P::Ty, P::Err>>
fn field_mut<'a, P>( &'a mut self, path: P, ) -> NormalizeFieldsOut<Result<&'a mut P::Ty, P::Err>>
Gets a mutable reference to a field,determined by
path
. Read moreSource§fn fields_mut<'a, P>(
&'a mut self,
path: P,
) -> RevGetMultiFieldMutOut<'a, P, Self>where
P: RevGetMultiFieldMut<'a, Self>,
fn fields_mut<'a, P>(
&'a mut self,
path: P,
) -> RevGetMultiFieldMutOut<'a, P, Self>where
P: RevGetMultiFieldMut<'a, Self>,
Gets mutable references to multiple fields,determined by
path
. Read moreSource§fn into_field<P>(self, path: P) -> NormalizeFieldsOut<Result<P::Ty, P::Err>>
fn into_field<P>(self, path: P) -> NormalizeFieldsOut<Result<P::Ty, P::Err>>
Converts ´self´ into a field,determined by
path
. Read moreSource§fn into_fields<P>(self, path: P) -> RevIntoMultiFieldOut<P, Self>where
P: RevIntoMultiField<Self>,
Self: Sized,
fn into_fields<P>(self, path: P) -> RevIntoMultiFieldOut<P, Self>where
P: RevIntoMultiField<Self>,
Self: Sized,
Converts
self
into multiple fields by value. Read moreSource§fn is_variant<P>(&self, _path: P) -> bool
fn is_variant<P>(&self, _path: P) -> bool
Checks whether an enum is a particular variant. Read more
Source§fn into_struc<U>(self) -> Uwhere
Self: IntoStructural<U>,
fn into_struc<U>(self) -> Uwhere
Self: IntoStructural<U>,
Converts this into another structural type using
IntoStructural
. Read moreSource§fn try_into_struc<U>(self) -> Result<U, TryFromError<Self, Self::Error>>where
Self: TryIntoStructural<U>,
fn try_into_struc<U>(self) -> Result<U, TryFromError<Self, Self::Error>>where
Self: TryIntoStructural<U>,
Performs a fallible conversion into another structural type using
TryIntoStructural
. Read moreSource§impl<This, T> TryIntoStructural<T> for Thiswhere
T: TryFromStructural<This>,
impl<This, T> TryIntoStructural<T> for Thiswhere
T: TryFromStructural<This>,
Source§type Error = <T as TryFromStructural<This>>::Error
type Error = <T as TryFromStructural<This>>::Error
The error parameter of
TryFromError
,
returned from try_into_structural
on conversion error.Source§fn try_into_structural(
self,
) -> Result<T, TryFromError<This, <This as TryIntoStructural<T>>::Error>>
fn try_into_structural( self, ) -> Result<T, TryFromError<This, <This as TryIntoStructural<T>>::Error>>
Performs the conversion
Source§impl<T> TypeIdentity for Twhere
T: ?Sized,
impl<T> TypeIdentity for Twhere
T: ?Sized,
Source§fn into_type_val(self) -> Self::Type
fn into_type_val(self) -> Self::Type
Converts a value back to the original type.
Source§fn into_type_ref(&self) -> &Self::Type
fn into_type_ref(&self) -> &Self::Type
Converts a reference back to the original type.
Source§fn into_type_mut(&mut self) -> &mut Self::Type
fn into_type_mut(&mut self) -> &mut Self::Type
Converts a mutable reference back to the original type.
Source§fn into_type_box(self: Box<Self>) -> Box<Self::Type>
fn into_type_box(self: Box<Self>) -> Box<Self::Type>
Converts a box back to the original type.
Source§fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>
fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>
Converts an Arc back to the original type.
Source§fn from_type_val(this: Self::Type) -> Self
fn from_type_val(this: Self::Type) -> Self
Converts a value back to the original type.
Source§fn from_type_ref(this: &Self::Type) -> &Self
fn from_type_ref(this: &Self::Type) -> &Self
Converts a reference back to the original type.
Source§fn from_type_mut(this: &mut Self::Type) -> &mut Self
fn from_type_mut(this: &mut Self::Type) -> &mut Self
Converts a mutable reference back to the original type.
Source§fn from_type_box(this: Box<Self::Type>) -> Box<Self>
fn from_type_box(this: Box<Self::Type>) -> Box<Self>
Converts a box back to the original type.