Enum Type
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),
}
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§
§impl Type
impl Type
pub fn unwrap_list(&self) -> &List
pub fn unwrap_list(&self) -> &List
pub fn unwrap_record(&self) -> &Record
pub fn unwrap_record(&self) -> &Record
pub fn unwrap_tuple(&self) -> &Tuple
pub fn unwrap_tuple(&self) -> &Tuple
pub 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
.
pub fn unwrap_enum(&self) -> &Enum
pub fn unwrap_enum(&self) -> &Enum
pub 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
.
pub 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
.
pub fn unwrap_flags(&self) -> &Flags
pub fn unwrap_flags(&self) -> &Flags
pub fn unwrap_own(&self) -> &ResourceType
pub fn unwrap_own(&self) -> &ResourceType
pub 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,
§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.§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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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