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 From<PackageName> for String
impl From<PackageName> for String
source§fn from(name: PackageName) -> String
fn from(name: PackageName) -> String
Converts to this type from the input type.
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 for PackageName
impl PartialEq for PackageName
source§impl PartialOrd for PackageName
impl PartialOrd for PackageName
source§impl Serialize for PackageName
impl Serialize for PackageName
impl Eq for PackageName
impl StructuralPartialEq for PackageName
Auto Trait Implementations§
impl Freeze for PackageName
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.