gravel_ffi

Type Alias FrontendMessageNe

source
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>

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>,

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>,

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>,

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>

pub const unsafe fn transmute_enum<F>(self) -> NonExhaustive<F, S, I>

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 const unsafe fn transmute_enum_ref<F>(&self) -> &NonExhaustive<F, S, I>

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>

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 as CanTransmuteElement<NonExhaustive<F, S, I>>>::TransmutedPtr
where 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,

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>,

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>>>

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

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

Gets the value of the discriminant of the enum.

§

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>,

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,

Deserializes a NonExhaustive<_> from a proxy.

Trait Implementations

§

impl<E, S, I> Clone for NonExhaustive<E, S, I>
where I: InterfaceType<Clone = Implemented<Clone>>,

§

fn clone(&self) -> NonExhaustive<E, S, I>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<E, S, I> Debug for NonExhaustive<E, S, I>
where I: InterfaceType<Debug = Implemented<Debug>>,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

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>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<E, S, I> Display for NonExhaustive<E, S, I>
where I: InterfaceType<Display = Implemented<Display>>,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<E, S, I> Drop for NonExhaustive<E, S, I>

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

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)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
§

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>

The 'static equivalent of Self
§

impl<E, S, I> Hash for NonExhaustive<E, S, I>
where I: InterfaceType<Hash = Implemented<Hash>>,

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<E, S, I> NonExhaustiveSharedOps for NonExhaustive<E, S, I>
where E: GetEnumInfo,

§

type Discriminant = <E as GetEnumInfo>::Discriminant

The type of the discriminant of the wrapped enum.
§

fn get_discriminant_(&self) -> <E as GetEnumInfo>::Discriminant

Gets the discriminant of the wrapped enum.
§

fn enum_info_(&self) -> &'static EnumInfo

Gets miscelaneous information about the wrapped enum
§

impl<E, S, I> Ord for NonExhaustive<E, S, I>
where I: InterfaceType<Ord = Implemented<Ord>>, NonExhaustive<E, S, I>: PartialOrd + Eq,

§

fn cmp(&self, other: &NonExhaustive<E, S, I>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl<E, S, I> PartialEq<E> for NonExhaustive<E, S, I>
where E: GetEnumInfo + PartialEq, I: InterfaceType<PartialEq = Implemented<PartialEq>>,

§

fn eq(&self, other: &E) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<E, S, I1, I2> PartialEq<NonExhaustive<E, S, I2>> for NonExhaustive<E, S, I1>
where I1: InterfaceType<PartialEq = Implemented<PartialEq>>,

§

fn eq(&self, other: &NonExhaustive<E, S, I2>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

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>,

§

fn partial_cmp(&self, other: &E) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

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>>,

§

fn partial_cmp(&self, other: &NonExhaustive<E, S, I2>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

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,

Serialize this value into the given Serde serializer. Read more
§

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,

§

const LAYOUT: &'static TypeLayout = _

The layout of the type provided by implementors.
§

type IsNonZeroType = False

Whether this type has a single invalid bit-pattern. Read more
§

const ABI_CONSTS: AbiConsts = _

const-equivalents of the associated types.
§

impl<E, S, I> Eq for NonExhaustive<E, S, I>
where NonExhaustive<E, S, I>: PartialEq, I: InterfaceType<Eq = Implemented<Eq>>,