pub struct TStr<T>(/* private fields */);
Expand description
Type-level string,used for identifiers in field paths.
This type is always zero sized.
This cannot be converted to a &'static str
constant
(if you can figure out a cheap way to do that please create an issue/pull request).
§Semver concerns
The private __TS
type appears as a type argument of TStr
in the output of macros from this crate,
the __TS
type must not be used by name outside of the structural
and structural_derive
crates.
Direct use of the __TS
type will cause compilation errors
whenever any other crate uses the “use_const_str” cargo feature,
which changes __TS
to use const generics to improve error messages.
Also,using the “use_const_str” feature to use the __TS
type by name wouldn’t
protect from breakage,
since other crates can use the “disable_const_str” feature to disable
const generics (this feature is useful to work around bugs in const generics).
§TStr type
You can get a TStr type (to use as a type argument) with the TS
macro,
which takes a string literal/ident/integer as input.
§TStr construction
TStr<_>
can be constructed with:
-
the
ts
macro,which takes a string literal/ident/integer as input. -
the
fp
macro,when a single string literal/ident/integer in passed, prefer usingts
if you want aTStr
to always be constructed, sincefp
can produce other types depending on the arguments. -
the
NEW
inherent associated constant. -
The
<TStr<_> as ConstDefault>::DEFAULT
associated constant.
Examples:
-
ts!(foo)
: TStr equivalent of “foo” -
ts!("bar")
: TStr equivalent of “bar” -
ts!(1)
: TStr equivalent of “1” -
ts!(100)
: TStr equivalent of “100” -
fp!(foo)
: TStr equivalent of “foo” -
fp!("bar")
: TStr equivalent of “bar” -
fp!("@me")
: TStr equivalent of “@me” -
fp!(100)
: TStr equivalent of “100” -
<TS!(0)>::NEW
: TStr equivalent of “0” -
<TS!(0)>::DEFAULT
: TStr equivalent of “0” (requires importing theConstDefault
trait) -
<TS!("hello")>::NEW
: TStr equivalent of “hello” -
<TS!(world)>::NEW
: TStr equivalent of “world” -
<TS!(100)>::NEW
: TStr equivalent of “100”
§Example
For an example of constructing TStr
using the ts
macro,
and constructing other field paths with it,
you can look in the docs for the ts
macro.
Implementations§
Source§impl<T> TStr<T>
impl<T> TStr<T>
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.
Trait Implementations§
Source§impl<'a, T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for &'a T
impl<'a, T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for &'a T
Source§fn get_vfield_(
&self,
vname: TStr<__V>,
fname: __F,
) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
fn get_vfield_( &self, vname: TStr<__V>, fname: __F, ) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
F
field in the V
variant by reference.Source§unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
F
field in the V
variant by reference,
without checking that the enum is currently the V
variant. Read moreSource§impl<'a, T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for &'a mut T
impl<'a, T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for &'a mut T
Source§fn get_vfield_(
&self,
vname: TStr<__V>,
fname: __F,
) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
fn get_vfield_( &self, vname: TStr<__V>, fname: __F, ) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
F
field in the V
variant by reference.Source§unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
F
field in the V
variant by reference,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for Arc<T>
impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for Arc<T>
Source§fn get_vfield_(
&self,
vname: TStr<__V>,
fname: __F,
) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
fn get_vfield_( &self, vname: TStr<__V>, fname: __F, ) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
F
field in the V
variant by reference.Source§unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
F
field in the V
variant by reference,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for Box<T>
impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for Box<T>
Source§fn get_vfield_(
&self,
vname: TStr<__V>,
fname: __F,
) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
fn get_vfield_( &self, vname: TStr<__V>, fname: __F, ) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
F
field in the V
variant by reference.Source§unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
F
field in the V
variant by reference,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for FieldCloner<T>where
T: GetVariantField<TStr<__V>, __F, Ty = __Ty>,
impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for FieldCloner<T>where
T: GetVariantField<TStr<__V>, __F, Ty = __Ty>,
Source§fn get_vfield_(
&self,
vname: TStr<__V>,
fname: __F,
) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
fn get_vfield_( &self, vname: TStr<__V>, fname: __F, ) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
F
field in the V
variant by reference.Source§unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
F
field in the V
variant by reference,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for ManuallyDrop<T>where
T: GetVariantField<TStr<__V>, __F, Ty = __Ty>,
impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for ManuallyDrop<T>where
T: GetVariantField<TStr<__V>, __F, Ty = __Ty>,
Source§fn get_vfield_(
&self,
vname: TStr<__V>,
fname: __F,
) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
fn get_vfield_( &self, vname: TStr<__V>, fname: __F, ) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
F
field in the V
variant by reference.Source§unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
F
field in the V
variant by reference,
without checking that the enum is currently the V
variant. Read moreSource§impl<P, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for Pin<P>
impl<P, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for Pin<P>
Source§fn get_vfield_(
&self,
vname: TStr<__V>,
fname: __F,
) -> Option<&GetVariantFieldType<P::Target, TStr<__V>, __F>>
fn get_vfield_( &self, vname: TStr<__V>, fname: __F, ) -> Option<&GetVariantFieldType<P::Target, TStr<__V>, __F>>
F
field in the V
variant by reference.Source§unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
F
field in the V
variant by reference,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for Rc<T>
impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for Rc<T>
Source§fn get_vfield_(
&self,
vname: TStr<__V>,
fname: __F,
) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
fn get_vfield_( &self, vname: TStr<__V>, fname: __F, ) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
F
field in the V
variant by reference.Source§unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
F
field in the V
variant by reference,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for StrucWrapper<T>where
T: GetVariantField<TStr<__V>, __F, Ty = __Ty>,
impl<T, __V, __F, __Ty> GetVariantField<TStr<__V>, __F> for StrucWrapper<T>where
T: GetVariantField<TStr<__V>, __F, Ty = __Ty>,
Source§fn get_vfield_(
&self,
vname: TStr<__V>,
fname: __F,
) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
fn get_vfield_( &self, vname: TStr<__V>, fname: __F, ) -> Option<&GetVariantFieldType<T, TStr<__V>, __F>>
F
field in the V
variant by reference.Source§unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
unsafe fn get_vfield_unchecked(&self, variant: V, field: F) -> &Self::Ty
F
field in the V
variant by reference,
without checking that the enum is currently the V
variant. Read moreSource§impl<'a, T, __V, __F, __Ty> GetVariantFieldMut<TStr<__V>, __F> for &'a mut T
impl<'a, T, __V, __F, __Ty> GetVariantFieldMut<TStr<__V>, __F> for &'a mut T
Source§fn get_vfield_mut_(&mut self, vname: TStr<__V>, fname: __F) -> Option<&mut __Ty>
fn get_vfield_mut_(&mut self, vname: TStr<__V>, fname: __F) -> Option<&mut __Ty>
F
field in the V
variant by mutable reference.Source§unsafe fn get_vfield_raw_mut_(
this: *mut (),
vname: TStr<__V>,
fname: __F,
) -> Option<NonNull<__Ty>>where
Self: Sized,
unsafe fn get_vfield_raw_mut_(
this: *mut (),
vname: TStr<__V>,
fname: __F,
) -> Option<NonNull<__Ty>>where
Self: Sized,
Source§fn get_vfield_raw_mut_unchecked_fn(&self) -> GetFieldRawMutFn<__F, __Ty>
fn get_vfield_raw_mut_unchecked_fn(&self) -> GetFieldRawMutFn<__F, __Ty>
get_vfield_raw_mut_unchecked
method. Read moreSource§fn get_vfield_raw_mut_fn(&self) -> GetVFieldRawMutFn<TStr<__V>, __F, __Ty>
fn get_vfield_raw_mut_fn(&self) -> GetVFieldRawMutFn<TStr<__V>, __F, __Ty>
get_vfield_raw_mut_
method. Read moreSource§unsafe fn get_vfield_mut_unchecked(
&mut self,
variant: V,
field: F,
) -> &mut Self::Ty
unsafe fn get_vfield_mut_unchecked( &mut self, variant: V, field: F, ) -> &mut Self::Ty
F
field in the V
variant by mutable reference,
without checking that the enum is currently the V
variant. Read moreSource§unsafe fn get_vfield_raw_mut_unchecked(ptr: *mut (), field: F) -> *mut Self::Tywhere
Self: Sized,
V: ConstDefault,
unsafe fn get_vfield_raw_mut_unchecked(ptr: *mut (), field: F) -> *mut Self::Tywhere
Self: Sized,
V: ConstDefault,
F
field in the V
variant by raw pointer,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, __V, __F, __Ty> GetVariantFieldMut<TStr<__V>, __F> for Box<T>
impl<T, __V, __F, __Ty> GetVariantFieldMut<TStr<__V>, __F> for Box<T>
Source§fn get_vfield_mut_(&mut self, vname: TStr<__V>, fname: __F) -> Option<&mut __Ty>
fn get_vfield_mut_(&mut self, vname: TStr<__V>, fname: __F) -> Option<&mut __Ty>
F
field in the V
variant by mutable reference.Source§unsafe fn get_vfield_raw_mut_(
this: *mut (),
vname: TStr<__V>,
fname: __F,
) -> Option<NonNull<__Ty>>where
Self: Sized,
unsafe fn get_vfield_raw_mut_(
this: *mut (),
vname: TStr<__V>,
fname: __F,
) -> Option<NonNull<__Ty>>where
Self: Sized,
Source§fn get_vfield_raw_mut_unchecked_fn(&self) -> GetFieldRawMutFn<__F, __Ty>
fn get_vfield_raw_mut_unchecked_fn(&self) -> GetFieldRawMutFn<__F, __Ty>
get_vfield_raw_mut_unchecked
method. Read moreSource§fn get_vfield_raw_mut_fn(&self) -> GetVFieldRawMutFn<TStr<__V>, __F, __Ty>
fn get_vfield_raw_mut_fn(&self) -> GetVFieldRawMutFn<TStr<__V>, __F, __Ty>
get_vfield_raw_mut_
method. Read moreSource§unsafe fn get_vfield_mut_unchecked(
&mut self,
variant: V,
field: F,
) -> &mut Self::Ty
unsafe fn get_vfield_mut_unchecked( &mut self, variant: V, field: F, ) -> &mut Self::Ty
F
field in the V
variant by mutable reference,
without checking that the enum is currently the V
variant. Read moreSource§unsafe fn get_vfield_raw_mut_unchecked(ptr: *mut (), field: F) -> *mut Self::Tywhere
Self: Sized,
V: ConstDefault,
unsafe fn get_vfield_raw_mut_unchecked(ptr: *mut (), field: F) -> *mut Self::Tywhere
Self: Sized,
V: ConstDefault,
F
field in the V
variant by raw pointer,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, __V, __F, __Ty> GetVariantFieldMut<TStr<__V>, __F> for FieldCloner<T>
impl<T, __V, __F, __Ty> GetVariantFieldMut<TStr<__V>, __F> for FieldCloner<T>
Source§fn get_vfield_mut_(&mut self, vname: TStr<__V>, fname: __F) -> Option<&mut __Ty>
fn get_vfield_mut_(&mut self, vname: TStr<__V>, fname: __F) -> Option<&mut __Ty>
F
field in the V
variant by mutable reference.Source§unsafe fn get_vfield_raw_mut_(
this: *mut (),
vname: TStr<__V>,
fname: __F,
) -> Option<NonNull<__Ty>>where
Self: Sized,
unsafe fn get_vfield_raw_mut_(
this: *mut (),
vname: TStr<__V>,
fname: __F,
) -> Option<NonNull<__Ty>>where
Self: Sized,
Source§fn get_vfield_raw_mut_unchecked_fn(&self) -> GetFieldRawMutFn<__F, __Ty>
fn get_vfield_raw_mut_unchecked_fn(&self) -> GetFieldRawMutFn<__F, __Ty>
get_vfield_raw_mut_unchecked
method. Read moreSource§fn get_vfield_raw_mut_fn(&self) -> GetVFieldRawMutFn<TStr<__V>, __F, __Ty>
fn get_vfield_raw_mut_fn(&self) -> GetVFieldRawMutFn<TStr<__V>, __F, __Ty>
get_vfield_raw_mut_
method. Read moreSource§unsafe fn get_vfield_mut_unchecked(
&mut self,
variant: V,
field: F,
) -> &mut Self::Ty
unsafe fn get_vfield_mut_unchecked( &mut self, variant: V, field: F, ) -> &mut Self::Ty
F
field in the V
variant by mutable reference,
without checking that the enum is currently the V
variant. Read moreSource§unsafe fn get_vfield_raw_mut_unchecked(ptr: *mut (), field: F) -> *mut Self::Tywhere
Self: Sized,
V: ConstDefault,
unsafe fn get_vfield_raw_mut_unchecked(ptr: *mut (), field: F) -> *mut Self::Tywhere
Self: Sized,
V: ConstDefault,
F
field in the V
variant by raw pointer,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, __V, __F, __Ty> GetVariantFieldMut<TStr<__V>, __F> for ManuallyDrop<T>
impl<T, __V, __F, __Ty> GetVariantFieldMut<TStr<__V>, __F> for ManuallyDrop<T>
Source§fn get_vfield_mut_(&mut self, vname: TStr<__V>, fname: __F) -> Option<&mut __Ty>
fn get_vfield_mut_(&mut self, vname: TStr<__V>, fname: __F) -> Option<&mut __Ty>
F
field in the V
variant by mutable reference.Source§unsafe fn get_vfield_raw_mut_(
this: *mut (),
vname: TStr<__V>,
fname: __F,
) -> Option<NonNull<__Ty>>where
Self: Sized,
unsafe fn get_vfield_raw_mut_(
this: *mut (),
vname: TStr<__V>,
fname: __F,
) -> Option<NonNull<__Ty>>where
Self: Sized,
Source§fn get_vfield_raw_mut_unchecked_fn(&self) -> GetFieldRawMutFn<__F, __Ty>
fn get_vfield_raw_mut_unchecked_fn(&self) -> GetFieldRawMutFn<__F, __Ty>
get_vfield_raw_mut_unchecked
method. Read moreSource§fn get_vfield_raw_mut_fn(&self) -> GetVFieldRawMutFn<TStr<__V>, __F, __Ty>
fn get_vfield_raw_mut_fn(&self) -> GetVFieldRawMutFn<TStr<__V>, __F, __Ty>
get_vfield_raw_mut_
method. Read moreSource§unsafe fn get_vfield_mut_unchecked(
&mut self,
variant: V,
field: F,
) -> &mut Self::Ty
unsafe fn get_vfield_mut_unchecked( &mut self, variant: V, field: F, ) -> &mut Self::Ty
F
field in the V
variant by mutable reference,
without checking that the enum is currently the V
variant. Read moreSource§unsafe fn get_vfield_raw_mut_unchecked(ptr: *mut (), field: F) -> *mut Self::Tywhere
Self: Sized,
V: ConstDefault,
unsafe fn get_vfield_raw_mut_unchecked(ptr: *mut (), field: F) -> *mut Self::Tywhere
Self: Sized,
V: ConstDefault,
F
field in the V
variant by raw pointer,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, __V, __F, __Ty> GetVariantFieldMut<TStr<__V>, __F> for StrucWrapper<T>
impl<T, __V, __F, __Ty> GetVariantFieldMut<TStr<__V>, __F> for StrucWrapper<T>
Source§fn get_vfield_mut_(&mut self, vname: TStr<__V>, fname: __F) -> Option<&mut __Ty>
fn get_vfield_mut_(&mut self, vname: TStr<__V>, fname: __F) -> Option<&mut __Ty>
F
field in the V
variant by mutable reference.Source§unsafe fn get_vfield_raw_mut_(
this: *mut (),
vname: TStr<__V>,
fname: __F,
) -> Option<NonNull<__Ty>>where
Self: Sized,
unsafe fn get_vfield_raw_mut_(
this: *mut (),
vname: TStr<__V>,
fname: __F,
) -> Option<NonNull<__Ty>>where
Self: Sized,
Source§fn get_vfield_raw_mut_unchecked_fn(&self) -> GetFieldRawMutFn<__F, __Ty>
fn get_vfield_raw_mut_unchecked_fn(&self) -> GetFieldRawMutFn<__F, __Ty>
get_vfield_raw_mut_unchecked
method. Read moreSource§fn get_vfield_raw_mut_fn(&self) -> GetVFieldRawMutFn<TStr<__V>, __F, __Ty>
fn get_vfield_raw_mut_fn(&self) -> GetVFieldRawMutFn<TStr<__V>, __F, __Ty>
get_vfield_raw_mut_
method. Read moreSource§unsafe fn get_vfield_mut_unchecked(
&mut self,
variant: V,
field: F,
) -> &mut Self::Ty
unsafe fn get_vfield_mut_unchecked( &mut self, variant: V, field: F, ) -> &mut Self::Ty
F
field in the V
variant by mutable reference,
without checking that the enum is currently the V
variant. Read moreSource§unsafe fn get_vfield_raw_mut_unchecked(ptr: *mut (), field: F) -> *mut Self::Tywhere
Self: Sized,
V: ConstDefault,
unsafe fn get_vfield_raw_mut_unchecked(ptr: *mut (), field: F) -> *mut Self::Tywhere
Self: Sized,
V: ConstDefault,
F
field in the V
variant by raw pointer,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, V, F, Ty> IntoVariantField<TStr<V>, F> for Box<T>
impl<T, V, F, Ty> IntoVariantField<TStr<V>, F> for Box<T>
Source§fn into_vfield_(self, vname: TStr<V>, fname: F) -> Option<Ty>
fn into_vfield_(self, vname: TStr<V>, fname: F) -> Option<Ty>
F
field in the V
variant by value.Source§unsafe fn move_out_vfield_(
&mut self,
vname: TStr<V>,
fname: F,
moved: &mut MovedOutFields,
) -> Option<Ty>
unsafe fn move_out_vfield_( &mut self, vname: TStr<V>, fname: F, moved: &mut MovedOutFields, ) -> Option<Ty>
Source§unsafe fn into_vfield_unchecked_(
self,
variant_name: V,
field_name: F,
) -> Self::Tywhere
Self: Sized,
unsafe fn into_vfield_unchecked_(
self,
variant_name: V,
field_name: F,
) -> Self::Tywhere
Self: Sized,
Source§unsafe fn move_out_vfield_unchecked_(
&mut self,
variant_name: V,
field_name: F,
moved_fields: &mut MovedOutFields,
) -> Self::Ty
unsafe fn move_out_vfield_unchecked_( &mut self, variant_name: V, field_name: F, moved_fields: &mut MovedOutFields, ) -> Self::Ty
F
field in the V
variant by value,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, V, F> IntoVariantField<TStr<V>, F> for FieldCloner<T>
impl<T, V, F> IntoVariantField<TStr<V>, F> for FieldCloner<T>
Source§fn into_vfield_(self, variant_name: TStr<V>, field_name: F) -> Option<Self::Ty>
fn into_vfield_(self, variant_name: TStr<V>, field_name: F) -> Option<Self::Ty>
F
field in the V
variant by value.Source§unsafe fn move_out_vfield_(
&mut self,
variant_name: TStr<V>,
field_name: F,
_: &mut MovedOutFields,
) -> Option<Self::Ty>
unsafe fn move_out_vfield_( &mut self, variant_name: TStr<V>, field_name: F, _: &mut MovedOutFields, ) -> Option<Self::Ty>
Source§unsafe fn into_vfield_unchecked_(
self,
variant_name: V,
field_name: F,
) -> Self::Tywhere
Self: Sized,
unsafe fn into_vfield_unchecked_(
self,
variant_name: V,
field_name: F,
) -> Self::Tywhere
Self: Sized,
Source§unsafe fn move_out_vfield_unchecked_(
&mut self,
variant_name: V,
field_name: F,
moved_fields: &mut MovedOutFields,
) -> Self::Ty
unsafe fn move_out_vfield_unchecked_( &mut self, variant_name: V, field_name: F, moved_fields: &mut MovedOutFields, ) -> Self::Ty
F
field in the V
variant by value,
without checking that the enum is currently the V
variant. Read moreSource§impl<T, __V, __F, __Ty> IntoVariantField<TStr<__V>, __F> for StrucWrapper<T>where
T: IntoVariantField<TStr<__V>, __F, Ty = __Ty>,
impl<T, __V, __F, __Ty> IntoVariantField<TStr<__V>, __F> for StrucWrapper<T>where
T: IntoVariantField<TStr<__V>, __F, Ty = __Ty>,
Source§fn into_vfield_(self, vname: TStr<__V>, fname: __F) -> Option<__Ty>
fn into_vfield_(self, vname: TStr<__V>, fname: __F) -> Option<__Ty>
F
field in the V
variant by value.Source§unsafe fn move_out_vfield_(
&mut self,
vname: TStr<__V>,
fname: __F,
moved: &mut MovedOutFields,
) -> Option<__Ty>
unsafe fn move_out_vfield_( &mut self, vname: TStr<__V>, fname: __F, moved: &mut MovedOutFields, ) -> Option<__Ty>
Source§unsafe fn into_vfield_unchecked_(
self,
variant_name: V,
field_name: F,
) -> Self::Tywhere
Self: Sized,
unsafe fn into_vfield_unchecked_(
self,
variant_name: V,
field_name: F,
) -> Self::Tywhere
Self: Sized,
Source§unsafe fn move_out_vfield_unchecked_(
&mut self,
variant_name: V,
field_name: F,
moved_fields: &mut MovedOutFields,
) -> Self::Ty
unsafe fn move_out_vfield_unchecked_( &mut self, variant_name: V, field_name: F, moved_fields: &mut MovedOutFields, ) -> Self::Ty
F
field in the V
variant by value,
without checking that the enum is currently the V
variant. Read moreSource§impl<T> IsMultiFieldPath for TStr<T>
impl<T> IsMultiFieldPath for TStr<T>
Source§type PathUniqueness = UniquePaths
type PathUniqueness = UniquePaths
Source§impl<'a, T, __V> IsVariant<TStr<__V>> for &'a T
impl<'a, T, __V> IsVariant<TStr<__V>> for &'a T
Source§fn is_variant_(&self, name: TStr<__V>) -> bool
fn is_variant_(&self, name: TStr<__V>) -> bool
V
stands for.Source§impl<'a, T, __V> IsVariant<TStr<__V>> for &'a mut T
impl<'a, T, __V> IsVariant<TStr<__V>> for &'a mut T
Source§fn is_variant_(&self, name: TStr<__V>) -> bool
fn is_variant_(&self, name: TStr<__V>) -> bool
V
stands for.Source§impl<T, __V> IsVariant<TStr<__V>> for Arc<T>
impl<T, __V> IsVariant<TStr<__V>> for Arc<T>
Source§fn is_variant_(&self, name: TStr<__V>) -> bool
fn is_variant_(&self, name: TStr<__V>) -> bool
V
stands for.Source§impl<T, __V> IsVariant<TStr<__V>> for Box<T>
impl<T, __V> IsVariant<TStr<__V>> for Box<T>
Source§fn is_variant_(&self, name: TStr<__V>) -> bool
fn is_variant_(&self, name: TStr<__V>) -> bool
V
stands for.Source§impl<T, __V> IsVariant<TStr<__V>> for FieldCloner<T>
impl<T, __V> IsVariant<TStr<__V>> for FieldCloner<T>
Source§fn is_variant_(&self, name: TStr<__V>) -> bool
fn is_variant_(&self, name: TStr<__V>) -> bool
V
stands for.Source§impl<T, __V> IsVariant<TStr<__V>> for ManuallyDrop<T>
impl<T, __V> IsVariant<TStr<__V>> for ManuallyDrop<T>
Source§fn is_variant_(&self, name: TStr<__V>) -> bool
fn is_variant_(&self, name: TStr<__V>) -> bool
V
stands for.Source§impl<P, __V> IsVariant<TStr<__V>> for Pin<P>
impl<P, __V> IsVariant<TStr<__V>> for Pin<P>
Source§fn is_variant_(&self, name: TStr<__V>) -> bool
fn is_variant_(&self, name: TStr<__V>) -> bool
V
stands for.Source§impl<T, __V> IsVariant<TStr<__V>> for Rc<T>
impl<T, __V> IsVariant<TStr<__V>> for Rc<T>
Source§fn is_variant_(&self, name: TStr<__V>) -> bool
fn is_variant_(&self, name: TStr<__V>) -> bool
V
stands for.Source§impl<T, __V> IsVariant<TStr<__V>> for StrucWrapper<T>
impl<T, __V> IsVariant<TStr<__V>> for StrucWrapper<T>
Source§fn is_variant_(&self, name: TStr<__V>) -> bool
fn is_variant_(&self, name: TStr<__V>) -> bool
V
stands for.Source§impl<T> Ord for TStr<T>
impl<T> Ord for TStr<T>
Source§impl<T> PartialOrd for TStr<T>
impl<T> PartialOrd for TStr<T>
Source§impl<This, T> RevFieldErr<This> for TStr<T>
impl<This, T> RevFieldErr<This> for TStr<T>
Source§type Err = InfallibleAccess
type Err = InfallibleAccess
rev_*
methods. Read moreSource§impl<This, T> RevFieldType<This> for TStr<T>
impl<This, T> RevFieldType<This> for TStr<T>
Source§impl<'a, This, T> RevGetFieldImpl<'a, This> for TStr<T>
impl<'a, This, T> RevGetFieldImpl<'a, This> for TStr<T>
Source§fn rev_get_field(self, this: &'a This) -> Result<&'a This::Ty, InfallibleAccess>
fn rev_get_field(self, this: &'a This) -> Result<&'a This::Ty, InfallibleAccess>
self
represents inside of this
,by reference.Source§impl<'a, This, T> RevGetFieldMutImpl<'a, This> for TStr<T>
impl<'a, This, T> RevGetFieldMutImpl<'a, This> for TStr<T>
Source§fn rev_get_field_mut(
self,
this: &'a mut This,
) -> Result<&'a mut This::Ty, InfallibleAccess>
fn rev_get_field_mut( self, this: &'a mut This, ) -> Result<&'a mut This::Ty, InfallibleAccess>
self
represents inside of this
,by mutable reference.Source§unsafe fn rev_get_field_raw_mut(
self,
this: *mut This,
) -> Result<*mut This::Ty, InfallibleAccess>
unsafe fn rev_get_field_raw_mut( self, this: *mut This, ) -> Result<*mut This::Ty, InfallibleAccess>
Source§impl<'a, This, T> RevGetMultiFieldImpl<'a, This> for TStr<T>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, T> RevGetMultiFieldImpl<'a, This> for TStr<T>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 <TStr<T> as RevFieldType<This>>::Ty, <TStr<T> as RevFieldErr<This>>::Err>,)
type UnnormFields = (Result<&'a <TStr<T> as RevFieldType<This>>::Ty, <TStr<T> as RevFieldErr<This>>::Err>,)
Results<&'a _,_>
s referencing fields.Source§impl<'a, This, T> RevGetMultiFieldMutImpl<'a, This> for TStr<T>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, T> RevGetMultiFieldMutImpl<'a, This> for TStr<T>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 <TStr<T> as RevFieldType<This>>::Ty, <TStr<T> as RevFieldErr<This>>::Err>,)
type UnnormFieldsMut = (Result<&'a mut <TStr<T> as RevFieldType<This>>::Ty, <TStr<T> as RevFieldErr<This>>::Err>,)
Result<&mut _,E: IsFieldErr>
s.Source§type UnnormFieldsRawMut = (Result<*mut <TStr<T> as RevFieldType<This>>::Ty, <TStr<T> as RevFieldErr<This>>::Err>,)
type UnnormFieldsRawMut = (Result<*mut <TStr<T> as RevFieldType<This>>::Ty, <TStr<T> as RevFieldErr<This>>::Err>,)
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>>,)
this
,
usually a tuple of Result<&mut _,E: IsFieldErr>
s.Source§impl<This, T> RevIntoFieldImpl<This> for TStr<T>
impl<This, T> RevIntoFieldImpl<This> for TStr<T>
Source§fn rev_into_field(self, this: This) -> Result<This::Ty, InfallibleAccess>
fn rev_into_field(self, this: This) -> Result<This::Ty, InfallibleAccess>
self
represents inside of this
,by value.Source§impl<This, T> RevIntoMultiFieldImpl<This> for TStr<T>where
Self: RevIntoFieldImpl<This>,
RGFT<Self, This>: Sized,
Result<RGFT<Self, This>, RGFE<Self, This>>: NormalizeFields,
impl<This, T> RevIntoMultiFieldImpl<This> for TStr<T>where
Self: RevIntoFieldImpl<This>,
RGFT<Self, This>: Sized,
Result<RGFT<Self, This>, RGFE<Self, This>>: NormalizeFields,
Source§type UnnormIntoFields = (Result<<TStr<T> as RevFieldType<This>>::Ty, <TStr<T> as RevFieldErr<This>>::Err>,)
type UnnormIntoFields = (Result<<TStr<T> as RevFieldType<This>>::Ty, <TStr<T> as RevFieldErr<This>>::Err>,)
Result<_, E: IsFieldErr>
s.Source§impl<This, T> RevMoveOutFieldImpl<This> for TStr<T>
impl<This, T> RevMoveOutFieldImpl<This> for TStr<T>
impl<T> Copy for TStr<T>
impl<T> Eq for TStr<T>
impl<T> IsSingleFieldPath for TStr<T>
impl<T> IsTStr for TStr<T>
impl<T> ShallowFieldPath for TStr<T>
Auto Trait Implementations§
impl<T> Freeze for TStr<T>
impl<T> RefUnwindSafe for TStr<T>where
T: RefUnwindSafe,
impl<T> Send for TStr<T>where
T: Send,
impl<T> Sync for TStr<T>where
T: Sync,
impl<T> Unpin for TStr<T>where
T: Unpin,
impl<T> UnwindSafe for TStr<T>where
T: 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
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>
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>
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
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
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
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
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
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
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
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
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
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
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
Source§fn assert_ty(self, _other: PhantomData<fn() -> Self>) -> Selfwhere
Self: Sized,
fn assert_ty(self, _other: PhantomData<fn() -> Self>) -> Selfwhere
Self: Sized,
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,
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,
other
is the same type as self
.Source§fn ty_(&self) -> PhantomData<fn() -> Self>
fn ty_(&self) -> PhantomData<fn() -> Self>
Source§fn ty_inv(&self) -> PhantomData<fn(Self) -> Self>
fn ty_inv(&self) -> PhantomData<fn(Self) -> Self>
Source§fn ty_inv_ref(&self) -> PhantomData<Cell<&Self>>
fn ty_inv_ref(&self) -> PhantomData<Cell<&Self>>
Source§fn eq_id(&self, other: &Self) -> bool
fn eq_id(&self, other: &Self) -> bool
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
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,
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,
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
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Source§fn into_<T>(self, _: PhantomData<fn() -> T>) -> Twhere
Self: Into<T>,
fn into_<T>(self, _: PhantomData<fn() -> T>) -> Twhere
Self: Into<T>,
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
.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>>
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>,
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>>
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>>
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>,
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>>
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,
self
into multiple fields by value. Read moreSource§fn is_variant<P>(&self, _path: P) -> bool
fn is_variant<P>(&self, _path: P) -> bool
Source§fn into_struc<U>(self) -> Uwhere
Self: IntoStructural<U>,
fn into_struc<U>(self) -> Uwhere
Self: IntoStructural<U>,
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>,
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
TryFromError
,
returned from try_into_structural
on conversion error.