Struct wit_parser::PackageName
source · pub struct PackageName {
pub namespace: String,
pub name: String,
pub version: Option<Version>,
}
Expand description
A structure used to keep track of the name of a package, containing optional information such as a namespace and version information.
This is directly encoded as an “ID” in the binary component representation with an interfaced tacked on as well.
Fields§
§namespace: String
A namespace such as wasi
in wasi:foo/bar
name: String
The kebab-name of this package, which is always specified.
version: Option<Version>
Optional major/minor version information.
Implementations§
source§impl PackageName
impl PackageName
sourcepub fn interface_id(&self, interface: &str) -> String
pub fn interface_id(&self, interface: &str) -> String
Returns the ID that this package name would assign the interface
name
specified.
Trait Implementations§
source§impl Clone for PackageName
impl Clone for PackageName
source§fn clone(&self) -> PackageName
fn clone(&self) -> PackageName
Returns a copy 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 PackageName
impl Debug for PackageName
source§impl Display for PackageName
impl Display for PackageName
source§impl Hash for PackageName
impl Hash for PackageName
source§impl Ord for PackageName
impl Ord for PackageName
source§fn cmp(&self, other: &PackageName) -> Ordering
fn cmp(&self, other: &PackageName) -> 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<PackageName> for PackageName
impl PartialEq<PackageName> for PackageName
source§fn eq(&self, other: &PackageName) -> bool
fn eq(&self, other: &PackageName) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<PackageName> for PackageName
impl PartialOrd<PackageName> for PackageName
source§fn partial_cmp(&self, other: &PackageName) -> Option<Ordering>
fn partial_cmp(&self, other: &PackageName) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for PackageName
impl StructuralEq for PackageName
impl StructuralPartialEq for PackageName
Auto Trait Implementations§
impl RefUnwindSafe for PackageName
impl Send for PackageName
impl Sync for PackageName
impl Unpin for PackageName
impl UnwindSafe for PackageName
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.