Struct ComponentName
pub struct ComponentName { /* private fields */ }Expand description
An import or export name in the component model which is backed by T,
which defaults to String.
This name can be either:
- a plain label or “kebab string”:
a-b-c - a plain method name:
[method]a-b.c-d - a plain static method name:
[static]a-b.c-d - a getter or setter version of all of the above:
[get]a-b-cor[set]a-b-c,[method][get]a-b.c-dor[method][set]a-b.c-d,[static][get]a-b.c-dor[static][set]a-b.c-d - a plain constructor:
[constructor]a-b - an interface name:
wasi:cli/reactor@0.1.0
§Equality and hashing
Equality and hashing of plain names uses the component model’s definition
of “strongly-unique”, which is an equivalence relation (and trivially so,
because it basically string equality on “canonicalized” names). This means
that, for example, [method]foo.bar-baz and [static]FOO.ba-RB-az are
considered equal and will hash to the same value.
Implementations§
§impl ComponentName
impl ComponentName
pub fn new(name: &str, offset: u64) -> Result<ComponentName, Error>
pub fn new(name: &str, offset: u64) -> Result<ComponentName, Error>
Attempts to parse name as a valid component name, returning Err if
it’s not valid.
pub fn new_with_features(
name: &str,
offset: u64,
features: WasmFeatures,
) -> Result<ComponentName, Error>
pub fn new_with_features( name: &str, offset: u64, features: WasmFeatures, ) -> Result<ComponentName, Error>
Attempts to parse name as a valid component name, returning Err if
it’s not valid.
features can be used to enable or disable validation of certain forms
of supported import names.
pub fn kind(&self) -> ComponentNameKind<'_>
pub fn kind(&self) -> ComponentNameKind<'_>
Returns the ComponentNameKind corresponding to this name.
Trait Implementations§
§impl Clone for ComponentName
impl Clone for ComponentName
§fn clone(&self) -> ComponentName
fn clone(&self) -> ComponentName
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ComponentName
impl Debug for ComponentName
§impl Display for ComponentName
impl Display for ComponentName
impl Eq for ComponentName
§impl From<ComponentName> for String
impl From<ComponentName> for String
§fn from(name: ComponentName) -> String
fn from(name: ComponentName) -> String
§impl Hash for ComponentName
impl Hash for ComponentName
§impl Ord for ComponentName
impl Ord for ComponentName
§fn cmp(&self, other: &ComponentName) -> Ordering
fn cmp(&self, other: &ComponentName) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for ComponentName
impl PartialEq for ComponentName
Auto Trait Implementations§
impl Freeze for ComponentName
impl RefUnwindSafe for ComponentName
impl Send for ComponentName
impl Sync for ComponentName
impl Unpin for ComponentName
impl UnsafeUnpin for ComponentName
impl UnwindSafe for ComponentName
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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
§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
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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