pub type FrontendMessageNe = NonExhaustive<FrontendMessage, FrontendMessage_Storage, FrontendMessage_Interface>;
Expand description
Non-exhaustive wrapper around FrontendMessage
.
Aliased Type§
struct FrontendMessageNe { /* private fields */ }
Implementations
§impl<E, S, I> NonExhaustive<E, S, I>
impl<E, S, I> NonExhaustive<E, S, I>
pub const fn new(value: E) -> NonExhaustive<E, S, I>where
E: GetVTable<S, I> + GetEnumInfo<DefaultStorage = S, DefaultInterface = I>,
pub const fn new(value: E) -> NonExhaustive<E, S, I>where
E: GetVTable<S, I> + GetEnumInfo<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 const fn with_interface(value: E) -> NonExhaustive<E, S, I>where
E: GetVTable<S, I> + GetEnumInfo<DefaultStorage = S>,
pub const fn with_interface(value: E) -> NonExhaustive<E, S, I>where
E: GetVTable<S, I> + GetEnumInfo<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 const fn with_storage(value: E) -> NonExhaustive<E, S, I>where
E: GetVTable<S, I> + GetEnumInfo<DefaultInterface = I>,
pub const fn with_storage(value: E) -> NonExhaustive<E, S, I>where
E: GetVTable<S, I> + GetEnumInfo<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 const fn with_storage_and_interface(value: E) -> NonExhaustive<E, S, I>where
E: GetVTable<S, I>,
pub const fn with_storage_and_interface(value: E) -> NonExhaustive<E, S, I>where
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
.
§impl<E, S, I> NonExhaustive<E, S, I>
impl<E, S, I> NonExhaustive<E, S, I>
pub const unsafe fn transmute_enum<F>(self) -> NonExhaustive<F, S, I>
pub const unsafe fn transmute_enum<F>(self) -> NonExhaustive<F, S, I>
pub const unsafe fn transmute_enum_ref<F>(&self) -> &NonExhaustive<F, S, I>
pub const unsafe fn transmute_enum_ref<F>(&self) -> &NonExhaustive<F, S, I>
pub unsafe fn transmute_enum_mut<F>(&mut self) -> &mut NonExhaustive<F, S, I>
pub unsafe fn transmute_enum_mut<F>(&mut self) -> &mut NonExhaustive<F, S, I>
pub unsafe fn transmute_enum_ptr<P, F>(
this: P,
) -> <P as CanTransmuteElement<NonExhaustive<F, S, I>>>::TransmutedPtrwhere
P: Deref<Target = NonExhaustive<E, S, I>> + CanTransmuteElement<NonExhaustive<F, S, I>>,
pub unsafe fn transmute_enum_ptr<P, F>(
this: P,
) -> <P as CanTransmuteElement<NonExhaustive<F, S, I>>>::TransmutedPtrwhere
P: Deref<Target = NonExhaustive<E, S, I>> + 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>where
E: GetEnumInfo,
impl<E, S, I> NonExhaustive<E, S, I>where
E: GetEnumInfo,
pub fn as_enum(&self) -> Result<&E, UnwrapEnumError<&NonExhaustive<E, S, I>>>
pub fn as_enum(&self) -> Result<&E, UnwrapEnumError<&NonExhaustive<E, S, I>>>
wraps 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::{
new_a, new_b, new_c, Foo,
};
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 NonExhaustive<E, S, I>>>where
E: GetVTable<S, I>,
pub fn as_enum_mut(
&mut self,
) -> Result<&mut E, UnwrapEnumError<&mut NonExhaustive<E, S, I>>>where
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::{
new_a, new_b, new_c, Foo,
};
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<NonExhaustive<E, S, I>>>
pub fn into_enum(self) -> Result<E, UnwrapEnumError<NonExhaustive<E, S, I>>>
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::{
new_a, new_b, new_c, Foo,
};
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
pub fn is_valid_discriminant(&self) -> bool
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 const fn get_discriminant(&self) -> <E as GetEnumInfo>::Discriminant
pub const fn get_discriminant(&self) -> <E as GetEnumInfo>::Discriminant
Gets the value of the discriminant of the enum.
§impl<E, S, I> NonExhaustive<E, S, I>where
E: GetEnumInfo,
impl<E, S, I> NonExhaustive<E, S, I>where
E: GetEnumInfo,
pub fn serialize_into_proxy(
&self,
) -> Result<<I as SerializeEnum<E>>::Proxy, RBoxError_>where
I: InterfaceType<Serialize = Implemented<Serialize>> + SerializeEnum<E>,
pub fn serialize_into_proxy(
&self,
) -> Result<<I as SerializeEnum<E>>::Proxy, RBoxError_>where
I: InterfaceType<Serialize = Implemented<Serialize>> + SerializeEnum<E>,
It serializes a NonExhaustive<_>
into a proxy.
pub fn deserialize_from_proxy<'borr>(
proxy: <I as DeserializeEnum<'borr, NonExhaustive<E, S, I>>>::Proxy,
) -> Result<NonExhaustive<E, S, I>, RBoxError_>where
I: InterfaceType<Deserialize = Implemented<Deserialize>> + DeserializeEnum<'borr, NonExhaustive<E, S, I>>,
<I as DeserializeEnum<'borr, NonExhaustive<E, S, I>>>::Proxy: 'borr,
pub fn deserialize_from_proxy<'borr>(
proxy: <I as DeserializeEnum<'borr, NonExhaustive<E, S, I>>>::Proxy,
) -> Result<NonExhaustive<E, S, I>, RBoxError_>where
I: InterfaceType<Deserialize = Implemented<Deserialize>> + DeserializeEnum<'borr, NonExhaustive<E, S, I>>,
<I as DeserializeEnum<'borr, NonExhaustive<E, S, I>>>::Proxy: 'borr,
Deserializes a NonExhaustive<_>
from a proxy.
Trait Implementations
§impl<'de, E, S, I> Deserialize<'de> for NonExhaustive<E, S, I>where
E: 'de + GetVTable<S, I>,
S: 'de,
I: 'de + InterfaceType<Deserialize = Implemented<Deserialize>> + DeserializeEnum<'de, NonExhaustive<E, S, I>>,
<I as DeserializeEnum<'de, NonExhaustive<E, S, I>>>::Proxy: Deserialize<'de>,
impl<'de, E, S, I> Deserialize<'de> for NonExhaustive<E, S, I>where
E: 'de + GetVTable<S, I>,
S: 'de,
I: 'de + InterfaceType<Deserialize = Implemented<Deserialize>> + 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
.
§fn deserialize<D>(
deserializer: D,
) -> Result<NonExhaustive<E, S, I>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<NonExhaustive<E, S, I>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl<E, S, I> Display for NonExhaustive<E, S, I>where
I: InterfaceType<Display = Implemented<Display>>,
impl<E, S, I> Display for NonExhaustive<E, S, I>where
I: InterfaceType<Display = Implemented<Display>>,
§impl<E, S, I> Error for NonExhaustive<E, S, I>where
I: InterfaceType<Debug = Implemented<Debug>, Display = Implemented<Display>, Error = Implemented<Error>>,
impl<E, S, I> Error for NonExhaustive<E, S, I>where
I: InterfaceType<Debug = Implemented<Debug>, Display = Implemented<Display>, Error = Implemented<Error>>,
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
§impl<E, S, I> GetStaticEquivalent_ for NonExhaustive<E, S, I>where
E: GetStaticEquivalent_ + NonExhaustiveMarker<S>,
S: GetStaticEquivalent_,
I: GetStaticEquivalent_ + InterfaceType,
NonExhaustiveVtable_Ref<E, S, I>: StableAbi,
impl<E, S, I> GetStaticEquivalent_ for NonExhaustive<E, S, I>where
E: GetStaticEquivalent_ + NonExhaustiveMarker<S>,
S: GetStaticEquivalent_,
I: GetStaticEquivalent_ + InterfaceType,
NonExhaustiveVtable_Ref<E, S, I>: StableAbi,
§type StaticEquivalent = _static_NonExhaustive<<E as GetStaticEquivalent_>::StaticEquivalent, <S as GetStaticEquivalent_>::StaticEquivalent, <I as GetStaticEquivalent_>::StaticEquivalent>
type StaticEquivalent = _static_NonExhaustive<<E as GetStaticEquivalent_>::StaticEquivalent, <S as GetStaticEquivalent_>::StaticEquivalent, <I as GetStaticEquivalent_>::StaticEquivalent>
'static
equivalent of Self
§type Discriminant = <E as GetEnumInfo>::Discriminant
type Discriminant = <E as GetEnumInfo>::Discriminant
§fn get_discriminant_(&self) -> <E as GetEnumInfo>::Discriminant
fn get_discriminant_(&self) -> <E as GetEnumInfo>::Discriminant
§fn enum_info_(&self) -> &'static EnumInfo
fn enum_info_(&self) -> &'static EnumInfo
§impl<E, S, I> Ord for NonExhaustive<E, S, I>where
I: InterfaceType<Ord = Implemented<Ord>>,
NonExhaustive<E, S, I>: PartialOrd + Eq,
impl<E, S, I> Ord for NonExhaustive<E, S, I>where
I: InterfaceType<Ord = Implemented<Ord>>,
NonExhaustive<E, S, I>: PartialOrd + Eq,
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl<E, S, I> PartialEq<E> for NonExhaustive<E, S, I>where
E: GetEnumInfo + PartialEq,
I: InterfaceType<PartialEq = Implemented<PartialEq>>,
impl<E, S, I> PartialEq<E> for NonExhaustive<E, S, I>where
E: GetEnumInfo + PartialEq,
I: InterfaceType<PartialEq = Implemented<PartialEq>>,
§impl<E, S, I1, I2> PartialEq<NonExhaustive<E, S, I2>> for NonExhaustive<E, S, I1>where
I1: InterfaceType<PartialEq = Implemented<PartialEq>>,
impl<E, S, I1, I2> PartialEq<NonExhaustive<E, S, I2>> for NonExhaustive<E, S, I1>where
I1: InterfaceType<PartialEq = Implemented<PartialEq>>,
§impl<E, S, I> PartialOrd<E> for NonExhaustive<E, S, I>where
E: GetEnumInfo + PartialOrd,
I: InterfaceType<PartialOrd = Implemented<PartialOrd>>,
NonExhaustive<E, S, I>: PartialEq<E>,
impl<E, S, I> PartialOrd<E> for NonExhaustive<E, S, I>where
E: GetEnumInfo + PartialOrd,
I: InterfaceType<PartialOrd = Implemented<PartialOrd>>,
NonExhaustive<E, S, I>: PartialEq<E>,
§impl<E, S, I1, I2> PartialOrd<NonExhaustive<E, S, I2>> for NonExhaustive<E, S, I1>where
I1: InterfaceType<PartialOrd = Implemented<PartialOrd>>,
NonExhaustive<E, S, I1>: PartialEq<NonExhaustive<E, S, I2>>,
impl<E, S, I1, I2> PartialOrd<NonExhaustive<E, S, I2>> for NonExhaustive<E, S, I1>where
I1: InterfaceType<PartialOrd = Implemented<PartialOrd>>,
NonExhaustive<E, S, I1>: PartialEq<NonExhaustive<E, S, I2>>,
§impl<E, S, I> Serialize for NonExhaustive<E, S, I>where
I: InterfaceType<Serialize = Implemented<Serialize>> + SerializeEnum<E>,
<I as SerializeEnum<E>>::Proxy: Serialize,
impl<E, S, I> Serialize for NonExhaustive<E, S, I>where
I: InterfaceType<Serialize = Implemented<Serialize>> + SerializeEnum<E>,
<I as SerializeEnum<E>>::Proxy: Serialize,
First it serializes a NonExhaustive<_>
into a proxy,then it serializes that proxy.
§fn serialize<Z>(
&self,
serializer: Z,
) -> Result<<Z as Serializer>::Ok, <Z as Serializer>::Error>where
Z: Serializer,
fn serialize<Z>(
&self,
serializer: Z,
) -> Result<<Z as Serializer>::Ok, <Z as Serializer>::Error>where
Z: Serializer,
§impl<E, S, I> StableAbi for NonExhaustive<E, S, I>where
E: GetStaticEquivalent_ + NonExhaustiveMarker<S>,
S: GetStaticEquivalent_,
I: GetStaticEquivalent_ + InterfaceType,
NonExhaustiveVtable_Ref<E, S, I>: StableAbi,
<E as NonExhaustiveMarker<S>>::Marker: StableAbi,
impl<E, S, I> StableAbi for NonExhaustive<E, S, I>where
E: GetStaticEquivalent_ + NonExhaustiveMarker<S>,
S: GetStaticEquivalent_,
I: GetStaticEquivalent_ + InterfaceType,
NonExhaustiveVtable_Ref<E, S, I>: StableAbi,
<E as NonExhaustiveMarker<S>>::Marker: StableAbi,
§type IsNonZeroType = False
type IsNonZeroType = False
§const ABI_CONSTS: AbiConsts = _
const ABI_CONSTS: AbiConsts = _
const
-equivalents of the associated types.