pub enum Type {
Show 23 variants
Bool,
S8,
U8,
S16,
U16,
S32,
U32,
S64,
U64,
Float32,
Float64,
Char,
String,
List(List),
Record(Record),
Tuple(Tuple),
Variant(Variant),
Enum(Enum),
Option(OptionType),
Result(ResultType),
Flags(Flags),
Own(ResourceType),
Borrow(ResourceType),
}
Available on crate features
runtime
and component-model
only.Expand description
Represents a component model interface type
Variants§
Bool
S8
U8
S16
U16
S32
U32
S64
U64
Float32
Float64
Char
String
List(List)
Record(Record)
Tuple(Tuple)
Variant(Variant)
Enum(Enum)
Option(OptionType)
Result(ResultType)
Flags(Flags)
Own(ResourceType)
Borrow(ResourceType)
Implementations§
source§impl Type
impl Type
sourcepub fn unwrap_list(&self) -> &List
pub fn unwrap_list(&self) -> &List
sourcepub fn unwrap_record(&self) -> &Record
pub fn unwrap_record(&self) -> &Record
sourcepub fn unwrap_tuple(&self) -> &Tuple
pub fn unwrap_tuple(&self) -> &Tuple
sourcepub fn unwrap_variant(&self) -> &Variant
pub fn unwrap_variant(&self) -> &Variant
Retrieve the inner Variant
of a Type::Variant
.
§Panics
This will panic if self
is not a Type::Variant
.
sourcepub fn unwrap_enum(&self) -> &Enum
pub fn unwrap_enum(&self) -> &Enum
sourcepub fn unwrap_option(&self) -> &OptionType
pub fn unwrap_option(&self) -> &OptionType
Retrieve the inner OptionType
of a Type::Option
.
§Panics
This will panic if self
is not a Type::Option
.
sourcepub fn unwrap_result(&self) -> &ResultType
pub fn unwrap_result(&self) -> &ResultType
Retrieve the inner ResultType
of a Type::Result
.
§Panics
This will panic if self
is not a Type::Result
.
sourcepub fn unwrap_flags(&self) -> &Flags
pub fn unwrap_flags(&self) -> &Flags
sourcepub fn unwrap_own(&self) -> &ResourceType
pub fn unwrap_own(&self) -> &ResourceType
sourcepub fn unwrap_borrow(&self) -> &ResourceType
pub fn unwrap_borrow(&self) -> &ResourceType
Retrieve the inner ResourceType
of a Type::Borrow
.
§Panics
This will panic if self
is not a Type::Borrow
.
Trait Implementations§
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more