pub struct InterfacePath { /* private fields */ }
Expand description
Represents a path to a WIT interface, which may be local (without a package name) or foreign (with a package name). The version is optional in both cases.
Implementations§
Source§impl InterfacePath
impl InterfacePath
pub const fn new( package_name: Option<String>, interface_name: String, version: Option<Version>, ) -> Self
Sourcepub fn package_name(&self) -> Option<&str>
pub fn package_name(&self) -> Option<&str>
Returns the package name component of the interface path, if one is specified.
Sourcepub fn interface_name(&self) -> &str
pub fn interface_name(&self) -> &str
Returns the interface name component of the interface path.
Sourcepub fn version(&self) -> Option<&Version>
pub fn version(&self) -> Option<&Version>
Returns the version component of the interface path, if one is specified.
Sourcepub fn into_foreign(self) -> Option<ForeignInterfacePath>
pub fn into_foreign(self) -> Option<ForeignInterfacePath>
Converts this InterfacePath
into a ForeignInterfacePath
, if it has a package name,
otherwise returns None
.
Trait Implementations§
Source§impl Clone for InterfacePath
impl Clone for InterfacePath
Source§fn clone(&self) -> InterfacePath
fn clone(&self) -> InterfacePath
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for InterfacePath
impl Debug for InterfacePath
Source§impl Display for InterfacePath
impl Display for InterfacePath
Source§impl From<ForeignInterfacePath> for InterfacePath
impl From<ForeignInterfacePath> for InterfacePath
Source§fn from(path: ForeignInterfacePath) -> Self
fn from(path: ForeignInterfacePath) -> Self
Converts to this type from the input type.
Source§impl FromStr for InterfacePath
impl FromStr for InterfacePath
Source§impl Hash for InterfacePath
impl Hash for InterfacePath
Source§impl Ord for InterfacePath
impl Ord for InterfacePath
Source§fn cmp(&self, other: &InterfacePath) -> Ordering
fn cmp(&self, other: &InterfacePath) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for InterfacePath
impl PartialEq for InterfacePath
Source§impl PartialOrd for InterfacePath
impl PartialOrd for InterfacePath
impl Eq for InterfacePath
impl StructuralPartialEq for InterfacePath
Auto Trait Implementations§
impl Freeze for InterfacePath
impl RefUnwindSafe for InterfacePath
impl Send for InterfacePath
impl Sync for InterfacePath
impl Unpin for InterfacePath
impl UnwindSafe for InterfacePath
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§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