[−][src]Struct abi_stable::nonexhaustive_enum::NonExhaustive
A generic type for all ffi-safe non-exhaustive enums.
This type allows adding variants to enums it wraps in ABI compatible versions of a library.
Generic parameters
E
This is the enum that this was constructed from, and can be unwrapped back into if it's one of the valid variants in this context.
S
The storage type,used to store the enum opaquely.
This has to be at least the size and alignment of the wrapped enum.
This is necessary because:
-
The compiler assumes that an enum cannot be a variant outside the ones it sees.
-
To give some flexibility to grow the enum in semver compatible versions of a library.
I
The interface of the enum(it implements InterfaceType
),
determining which traits are required when constructing NonExhaustive<>
and which are available afterwards.
Example
Say that we define an error type for a library.
Version 1.0.
use abi_stable::{ StableAbi, nonexhaustive_enum::{NonExhaustiveFor,NonExhaustive}, std_types::RString, sabi_trait, }; #[repr(u8)] #[derive(StableAbi,Debug,Clone,PartialEq)] #[sabi(kind(WithNonExhaustive( size="[usize;8]", traits(Debug,Clone,PartialEq), )))] pub enum Error{ #[doc(hidden)] __NonExhaustive, CouldNotFindItem{ name:RString, }, OutOfStock{ id:usize, name:RString, }, } fn returns_could_not_find_item(name:RString)->NonExhaustiveFor<Error>{ let e=Error::CouldNotFindItem{name}; NonExhaustive::new(e) } fn returns_out_of_stock(id:usize,name:RString)->NonExhaustiveFor<Error>{ let e=Error::OutOfStock{id,name}; NonExhaustive::new(e) }
Then in 1.1 we add another error variant,returned only by new library functions.
use abi_stable::{ StableAbi, nonexhaustive_enum::{NonExhaustiveFor,NonExhaustive}, std_types::RString, sabi_trait, }; #[repr(u8)] #[derive(StableAbi,Debug,Clone,PartialEq)] #[sabi(kind(WithNonExhaustive( size="[usize;8]", traits(Debug,Clone,PartialEq), )))] pub enum Error{ #[doc(hidden)] __NonExhaustive, CouldNotFindItem{ name:RString, }, OutOfStock{ id:usize, name:RString, }, InvalidItemId{ id:usize, }, } fn returns_invalid_item_id()->NonExhaustiveFor<Error>{ NonExhaustive::new(Error::InvalidItemId{id:100}) }
If a library user attempted to unwrap Error::InvalidItemId
(using NonExhaustive::as_enum/as_enum_mut/into_enum)
with the 1.0 version of Error
they would get an Err(..)
back.
Implementations
impl<E, S, I> NonExhaustive<E, S, I>
[src]
pub fn new(value: E) -> Self where
E: GetVTable<S, I, DefaultStorage = S, DefaultInterface = I>,
[src]
E: GetVTable<S, I, DefaultStorage = S, DefaultInterface = I>,
Constructs a NonExhaustive<>
from value
using its default interface and storage.
Panic
This panics if the storage has an alignment or size smaller than that of E
.
pub fn with_interface(value: E) -> Self where
E: GetVTable<S, I, DefaultStorage = S>,
[src]
E: GetVTable<S, I, DefaultStorage = S>,
Constructs a NonExhaustive<>
from value
using its default storage
and a custom interface.
Panic
This panics if the storage has an alignment or size smaller than that of E
.
pub fn with_storage(value: E) -> Self where
E: GetVTable<S, I, DefaultInterface = I>,
[src]
E: GetVTable<S, I, DefaultInterface = I>,
Constructs a NonExhaustive<>
from value
using its default interface
and a custom storage.
Panic
This panics if the storage has an alignment or size smaller than that of E
.
pub fn with_storage_and_interface(value: E) -> Self where
E: GetVTable<S, I>,
[src]
E: GetVTable<S, I>,
Constructs a NonExhaustive<>
from value
using both a custom interface and storage.
Panic
This panics if the storage has an alignment or size smaller than that of E
.
pub fn check_alignment() -> bool
[src]
Checks that the alignment of E
is correct,returning true
if it is.
pub fn check_size() -> bool
[src]
Checks that the size of E
is correct,returning true
if it is.
pub fn assert_fits_within_storage()
[src]
Asserts that E
fits within S
,with the correct alignment and size.
impl<E, S, I> NonExhaustive<E, S, I> where
E: GetEnumInfo,
[src]
E: GetEnumInfo,
pub fn as_enum(&self) -> Result<&E, UnwrapEnumError<&Self>>
[src]
Unwraps a reference to this NonExhaustive<>
into a reference to the original enum.
Errors
This returns an error if the wrapped enum is of a variant that is not valid in this context.
Example
This shows how some NonExhaustive<enum>
can be unwrapped, and others cannot.
That enum comes from a newer version of the library than this knows.
use abi_stable::nonexhaustive_enum::{ doc_enums::example_2::{Foo,new_a,new_b,new_c}, }; assert_eq!(new_a() .as_enum().ok(),Some(&Foo::A) ); assert_eq!(new_b(10).as_enum().ok(),Some(&Foo::B(10))); assert_eq!(new_b(77).as_enum().ok(),Some(&Foo::B(77))); assert_eq!(new_c().as_enum().ok() ,None );
pub fn as_enum_mut(&mut self) -> Result<&mut E, UnwrapEnumError<&mut Self>> where
E: GetVTable<S, I>,
[src]
E: GetVTable<S, I>,
Unwraps a mutable reference to this NonExhaustive<>
into a
mutable reference to the original enum.
Errors
This returns an error if the wrapped enum is of a variant that is not valid in this context.
Example
This shows how some NonExhaustive<enum>
can be unwrapped, and others cannot.
That enum comes from a newer version of the library than this knows.
use abi_stable::nonexhaustive_enum::{ doc_enums::example_1::{Foo,new_a,new_b,new_c}, }; assert_eq!(new_a() .as_enum_mut().ok(),Some(&mut Foo::A)); assert_eq!(new_b(10).as_enum_mut().ok(),None); assert_eq!(new_b(77).as_enum_mut().ok(),None); assert_eq!(new_c().as_enum_mut().ok() ,None);
pub fn into_enum(self) -> Result<E, UnwrapEnumError<Self>>
[src]
Unwraps this NonExhaustive<>
into the original enum.
Errors
This returns an error if the wrapped enum is of a variant that is not valid in this context.
Example
This shows how some NonExhaustive<enum>
can be unwrapped, and others cannot.
That enum comes from a newer version of the library than this knows.
use abi_stable::nonexhaustive_enum::{ doc_enums::example_2::{Foo,new_a,new_b,new_c}, }; assert_eq!(new_a() .into_enum().ok(),Some(Foo::A)); assert_eq!(new_b(10).into_enum().ok(),Some(Foo::B(10))); assert_eq!(new_b(77).into_enum().ok(),Some(Foo::B(77))); assert_eq!(new_c().into_enum().ok() ,None);
pub fn is_valid_discriminant(&self) -> bool
[src]
Returns whether the discriminant of this enum is valid in this context.
The only way for it to be invalid is if the dynamic library is a newer version than this knows.
pub fn get_discriminant(&self) -> E::Discriminant
[src]
Gets the value of the discriminant of the enum.
impl<E, S, I> NonExhaustive<E, S, I>
[src]
pub unsafe fn transmute_enum<F>(self) -> NonExhaustive<F, S, I>
[src]
Transmute this NonExhaustive<E,S,I>
into NonExhaustive<F,S,I>
,
changing the type of the enum it wraps.
Safety
This has the same safety requirements that std::mem::transmute
has.
Panics
This panics if the storage has an alignment or size smaller than that of F
.
pub unsafe fn transmute_enum_ref<F>(&self) -> &NonExhaustive<F, S, I>
[src]
Transmute this &NonExhaustive<E,S,I>
into &NonExhaustive<F,S,I>
,
changing the type of the enum it wraps.
Safety
This has the same safety requirements that std::mem::transmute
has.
Panics
This panics if the storage has an alignment or size smaller than that of F
.
pub unsafe fn transmute_enum_mut<F>(&mut self) -> &mut NonExhaustive<F, S, I>
[src]
Transmute this &mut NonExhaustive<E,S,I>
into &mut NonExhaustive<F,S,I>
,
changing the type of the enum it wraps.
Safety
This has the same safety requirements that std::mem::transmute
has.
Panics
This panics if the storage has an alignment or size smaller than that of F
.
pub unsafe fn transmute_enum_ptr<P, F>(this: P) -> P::TransmutedPtr where
P: Deref<Target = Self>,
P: CanTransmuteElement<NonExhaustive<F, S, I>>,
[src]
P: Deref<Target = Self>,
P: CanTransmuteElement<NonExhaustive<F, S, I>>,
Transmute this pointer to a NonExhaustive<E,S,I>
into
a pointer (of the same kind) to a NonExhaustive<F,S,I>
,
changing the type of the enum it wraps.
Safety
This has the same safety requirements that
abi_stable::pointer_traits::TransmuteElement::transmute_element
has.
Panics
This panics if the storage has an alignment or size smaller than that of F
.
impl<E, S, I> NonExhaustive<E, S, I>
[src]
pub fn serialize_into_proxy(&self) -> Result<I::Proxy, RBoxError> where
I: InterfaceBound<Serialize = Implemented<Serialize>>,
I: SerializeEnum<NonExhaustive<E, S, I>>,
[src]
I: InterfaceBound<Serialize = Implemented<Serialize>>,
I: SerializeEnum<NonExhaustive<E, S, I>>,
It serializes a NonExhaustive<_>
into a proxy.
pub fn deserialize_from_proxy<'borr>(proxy: I::Proxy) -> Result<Self, RBoxError> where
I: InterfaceBound<Deserialize = Implemented<Deserialize>>,
I: DeserializeEnum<'borr, NonExhaustive<E, S, I>>,
I::Proxy: 'borr,
E: GetEnumInfo,
[src]
I: InterfaceBound<Deserialize = Implemented<Deserialize>>,
I: DeserializeEnum<'borr, NonExhaustive<E, S, I>>,
I::Proxy: 'borr,
E: GetEnumInfo,
Deserializes a NonExhaustive<_>
from a proxy.
Trait Implementations
impl<E, S, I> Clone for NonExhaustive<E, S, I> where
I: InterfaceBound<Clone = Implemented<Clone>>,
[src]
I: InterfaceBound<Clone = Implemented<Clone>>,
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<E, S, I> Debug for NonExhaustive<E, S, I> where
I: InterfaceBound<Debug = Implemented<Debug>>,
[src]
I: InterfaceBound<Debug = Implemented<Debug>>,
impl<'de, E, S, I> Deserialize<'de> for NonExhaustive<E, S, I> where
E: 'de + GetVTable<S, I>,
S: 'de,
I: 'de + InterfaceBound<Deserialize = Implemented<Deserialize>>,
I: DeserializeEnum<'de, NonExhaustive<E, S, I>>,
<I as DeserializeEnum<'de, NonExhaustive<E, S, I>>>::Proxy: Deserialize<'de>,
[src]
E: 'de + GetVTable<S, I>,
S: 'de,
I: 'de + InterfaceBound<Deserialize = Implemented<Deserialize>>,
I: DeserializeEnum<'de, NonExhaustive<E, S, I>>,
<I as DeserializeEnum<'de, NonExhaustive<E, S, I>>>::Proxy: Deserialize<'de>,
First it Deserializes a string,then it deserializes into a
NonExhaustive<_>
,by using <I as DeserializeEnum>::deserialize_enum
.
pub fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl<E, S, I> Display for NonExhaustive<E, S, I> where
I: InterfaceBound<Display = Implemented<Display>>,
[src]
I: InterfaceBound<Display = Implemented<Display>>,
impl<E, S, I> Drop for NonExhaustive<E, S, I>
[src]
impl<E, S, I> Eq for NonExhaustive<E, S, I> where
Self: PartialEq,
I: InterfaceBound<Eq = Implemented<Eq>>,
[src]
Self: PartialEq,
I: InterfaceBound<Eq = Implemented<Eq>>,
impl<E, S, I> Error for NonExhaustive<E, S, I> where
I: InterfaceBound<Debug = Implemented<Debug>, Display = Implemented<Display>, Error = Implemented<Error>>,
[src]
I: InterfaceBound<Debug = Implemented<Debug>, Display = Implemented<Display>, Error = Implemented<Error>>,
pub fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl<E, S, I> GetStaticEquivalent_ for NonExhaustive<E, S, I> where
E: __GetStaticEquivalent_,
S: __GetStaticEquivalent_,
I: __GetStaticEquivalent_,
NonExhaustiveVtable_Ref<E, S, I>: StableAbi,
E: GetNonExhaustive<S>,
I: InterfaceBound,
[src]
E: __GetStaticEquivalent_,
S: __GetStaticEquivalent_,
I: __GetStaticEquivalent_,
NonExhaustiveVtable_Ref<E, S, I>: StableAbi,
E: GetNonExhaustive<S>,
I: InterfaceBound,
type StaticEquivalent = _static_NonExhaustive<__GetStaticEquivalent<E>, __GetStaticEquivalent<S>, __GetStaticEquivalent<I>>
impl<E, S, I> Hash for NonExhaustive<E, S, I> where
I: InterfaceBound<Hash = Implemented<Hash>>,
[src]
I: InterfaceBound<Hash = Implemented<Hash>>,
pub fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<E, S, I> NonExhaustiveSharedOps for NonExhaustive<E, S, I> where
E: GetEnumInfo,
[src]
E: GetEnumInfo,
type Discriminant = E::Discriminant
The type of the discriminant of the wrapped enum.
pub fn get_discriminant_(&self) -> E::Discriminant
[src]
pub fn enum_info_(&self) -> &'static EnumInfo
[src]
impl<'a, E, S, I> NonExhaustiveSharedOps for &'a NonExhaustive<E, S, I> where
E: GetEnumInfo,
[src]
E: GetEnumInfo,
type Discriminant = E::Discriminant
The type of the discriminant of the wrapped enum.
pub fn get_discriminant_(&self) -> E::Discriminant
[src]
pub fn enum_info_(&self) -> &'static EnumInfo
[src]
impl<'a, E, S, I> NonExhaustiveSharedOps for &'a mut NonExhaustive<E, S, I> where
E: GetEnumInfo,
[src]
E: GetEnumInfo,
type Discriminant = E::Discriminant
The type of the discriminant of the wrapped enum.
pub fn get_discriminant_(&self) -> E::Discriminant
[src]
pub fn enum_info_(&self) -> &'static EnumInfo
[src]
impl<E, S, I> Ord for NonExhaustive<E, S, I> where
I: InterfaceBound<Ord = Implemented<Ord>>,
Self: PartialOrd + Eq,
[src]
I: InterfaceBound<Ord = Implemented<Ord>>,
Self: PartialOrd + Eq,
pub fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<E, S, I> PartialEq<E> for NonExhaustive<E, S, I> where
E: GetEnumInfo + PartialEq,
I: InterfaceBound<PartialEq = Implemented<PartialEq>>,
[src]
E: GetEnumInfo + PartialEq,
I: InterfaceBound<PartialEq = Implemented<PartialEq>>,
impl<E, S, I1, I2> PartialEq<NonExhaustive<E, S, I2>> for NonExhaustive<E, S, I1> where
I1: InterfaceBound<PartialEq = Implemented<PartialEq>>,
[src]
I1: InterfaceBound<PartialEq = Implemented<PartialEq>>,
pub fn eq(&self, other: &NonExhaustive<E, S, I2>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<E, S, I> PartialOrd<E> for NonExhaustive<E, S, I> where
E: GetEnumInfo + PartialOrd,
I: InterfaceBound<PartialOrd = Implemented<PartialOrd>>,
Self: PartialEq<E>,
[src]
E: GetEnumInfo + PartialOrd,
I: InterfaceBound<PartialOrd = Implemented<PartialOrd>>,
Self: PartialEq<E>,
pub fn partial_cmp(&self, other: &E) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<E, S, I1, I2> PartialOrd<NonExhaustive<E, S, I2>> for NonExhaustive<E, S, I1> where
I1: InterfaceBound<PartialOrd = Implemented<PartialOrd>>,
Self: PartialEq<NonExhaustive<E, S, I2>>,
[src]
I1: InterfaceBound<PartialOrd = Implemented<PartialOrd>>,
Self: PartialEq<NonExhaustive<E, S, I2>>,
pub fn partial_cmp(&self, other: &NonExhaustive<E, S, I2>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<E, S, I> Serialize for NonExhaustive<E, S, I> where
I: InterfaceBound<Serialize = Implemented<Serialize>>,
I: SerializeEnum<NonExhaustive<E, S, I>>,
I::Proxy: Serialize,
[src]
I: InterfaceBound<Serialize = Implemented<Serialize>>,
I: SerializeEnum<NonExhaustive<E, S, I>>,
I::Proxy: Serialize,
First it serializes a NonExhaustive<_>
into a proxy,then it serializes that proxy.
impl<E, S, I> StableAbi for NonExhaustive<E, S, I> where
E: __GetStaticEquivalent_,
S: __GetStaticEquivalent_,
I: __GetStaticEquivalent_,
NonExhaustiveVtable_Ref<E, S, I>: StableAbi,
E: GetNonExhaustive<S>,
I: InterfaceBound,
<E as GetNonExhaustive<S>>::NonExhaustive: __StableAbi,
[src]
E: __GetStaticEquivalent_,
S: __GetStaticEquivalent_,
I: __GetStaticEquivalent_,
NonExhaustiveVtable_Ref<E, S, I>: StableAbi,
E: GetNonExhaustive<S>,
I: InterfaceBound,
<E as GetNonExhaustive<S>>::NonExhaustive: __StableAbi,
type IsNonZeroType = False
Whether this type has a single invalid bit-pattern. Read more
pub const LAYOUT: &'static TypeLayout
[src]
pub const ABI_CONSTS: AbiConsts
[src]
Auto Trait Implementations
impl<E, S, I> RefUnwindSafe for NonExhaustive<E, S, I> where
E: RefUnwindSafe,
I: RefUnwindSafe,
S: RefUnwindSafe,
E: RefUnwindSafe,
I: RefUnwindSafe,
S: RefUnwindSafe,
impl<E, S, I> Send for NonExhaustive<E, S, I> where
E: Sync,
I: Sync,
S: Send + Sync,
E: Sync,
I: Sync,
S: Send + Sync,
impl<E, S, I> Sync for NonExhaustive<E, S, I> where
E: Sync,
I: Sync,
S: Sync,
E: Sync,
I: Sync,
S: Sync,
impl<E, S, I> Unpin for NonExhaustive<E, S, I> where
S: Unpin,
S: Unpin,
impl<E, S, I> UnwindSafe for NonExhaustive<E, S, I> where
E: RefUnwindSafe,
I: RefUnwindSafe,
S: RefUnwindSafe + UnwindSafe,
E: RefUnwindSafe,
I: RefUnwindSafe,
S: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> BorrowOwned<'a> for T where
T: 'a + Clone,
[src]
T: 'a + Clone,
type ROwned = T
The owned type, stored in RCow::Owned
type RBorrowed = &'a T
The borrowed type, stored in RCow::Borrowed
pub fn r_borrow(
&'a <T as BorrowOwned<'a>>::ROwned
) -> <T as BorrowOwned<'a>>::RBorrowed
[src]
&'a <T as BorrowOwned<'a>>::ROwned
) -> <T as BorrowOwned<'a>>::RBorrowed
pub fn r_to_owned(
<T as BorrowOwned<'a>>::RBorrowed
) -> <T as BorrowOwned<'a>>::ROwned
[src]
<T as BorrowOwned<'a>>::RBorrowed
) -> <T as BorrowOwned<'a>>::ROwned
pub fn deref_borrowed(&<T as BorrowOwned<'a>>::RBorrowed) -> &T
[src]
pub fn deref_owned(&<T as BorrowOwned<'a>>::ROwned) -> &T
[src]
pub fn from_cow_borrow(&'a T) -> <T as BorrowOwned<'a>>::RBorrowed
[src]
pub fn from_cow_owned(<T as ToOwned>::Owned) -> <T as BorrowOwned<'a>>::ROwned
[src]
pub fn into_cow_borrow(<T as BorrowOwned<'a>>::RBorrowed) -> &'a T
[src]
pub fn into_cow_owned(<T as BorrowOwned<'a>>::ROwned) -> <T as ToOwned>::Owned
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> GetWithMetadata for T
[src]
type ForSelf = WithMetadata_<T, T>
This is always WithMetadata_<Self, Self>
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SelfOps for T where
T: ?Sized,
[src]
T: ?Sized,
pub const T: PhantomData<fn() -> Self>
[src]
pub const T_D: PhantomData<Self>
[src]
pub fn assert_ty(self, _other: PhantomData<fn() -> Self>) -> Self
[src]
pub fn assert_ty_ref(&self, _other: PhantomData<fn() -> Self>) -> &Self
[src]
pub fn assert_ty_mut(&mut self, _other: PhantomData<fn() -> Self>) -> &mut Self
[src]
pub fn ty_(&self) -> PhantomData<fn() -> Self>
[src]
pub fn ty_d(&self) -> PhantomData<Self>
[src]
pub fn ty_inv(&self) -> PhantomData<fn(Self) -> Self>
[src]
pub fn ty_inv_ref(&self) -> PhantomData<Cell<&Self>>
[src]
pub fn eq_id(&self, other: &Self) -> bool
[src]
pub fn piped<F, U>(self, f: F) -> U where
F: FnOnce(Self) -> U,
[src]
F: FnOnce(Self) -> U,
pub fn piped_ref<'a, F, U>(&'a self, f: F) -> U where
F: FnOnce(&'a Self) -> U,
[src]
F: FnOnce(&'a Self) -> U,
pub fn piped_mut<'a, F, U>(&'a mut self, f: F) -> U where
F: FnOnce(&'a mut Self) -> U,
[src]
F: FnOnce(&'a mut Self) -> U,
pub fn mutated<F>(self, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),
pub fn observe<F>(self, f: F) -> Self where
F: FnOnce(&Self),
[src]
F: FnOnce(&Self),
pub fn into_<T>(self, PhantomData<fn() -> T>) -> T where
Self: Into<T>,
[src]
Self: Into<T>,
pub fn as_ref_<T>(&self) -> &T where
Self: AsRef<T>,
T: ?Sized,
[src]
Self: AsRef<T>,
T: ?Sized,
pub fn as_mut_<T>(&mut self) -> &mut T where
Self: AsMut<T>,
T: ?Sized,
[src]
Self: AsMut<T>,
T: ?Sized,
pub fn drop_(self)
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<This> TransmuteElement for This where
This: ?Sized,
[src]
This: ?Sized,
pub unsafe fn transmute_element<T>(self) -> Self::TransmutedPtr where
Self: CanTransmuteElement<T>,
Self::Target: Sized,
[src]
Self: CanTransmuteElement<T>,
Self::Target: Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The error type returned when the conversion fails.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> TypeIdentity for T where
T: ?Sized,
[src]
T: ?Sized,
type Type = T
The same type as Self. Read more
pub fn into_type_val(self) -> Self::Type where
Self::Type: Sized,
[src]
Self::Type: Sized,
pub fn into_type_ref(&self) -> &Self::Type
[src]
pub fn into_type_mut(&mut self) -> &mut Self::Type
[src]
pub fn into_type_box(self: Box<Self, Global>) -> Box<Self::Type, Global>
[src]
pub fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>
[src]
pub fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>
[src]
pub fn from_type_val(this: Self::Type) -> Self where
Self::Type: Sized,
[src]
Self::Type: Sized,
pub fn from_type_ref(this: &Self::Type) -> &Self
[src]
pub fn from_type_mut(this: &mut Self::Type) -> &mut Self
[src]
pub fn from_type_box(this: Box<Self::Type, Global>) -> Box<Self, Global>
[src]
pub fn from_type_arc(this: Arc<Self::Type>) -> Arc<Self>
[src]
pub fn from_type_rc(this: Rc<Self::Type>) -> Rc<Self>
[src]
impl<This> ValidTag_Bounds for This where
This: Debug + Clone + PartialEq<This>,
[src]
This: Debug + Clone + PartialEq<This>,