pub struct Package { /* private fields */ }Expand description
The package part of a global id: manager, name and version.
use sealmap_model::{Package, Version};
let p = Package::current("npm", "@acme/web app").unwrap();
assert_eq!(p.name(), "@acme/web app");
assert_eq!(p.version(), &Version::Current);
assert!(Package::current("Cargo", "x").is_err()); // managers are lower-case
assert!(Package::current("cargo", " x").is_err()); // no edge spacesImplementations§
Source§impl Package
impl Package
Trait Implementations§
impl Eq for Package
Source§impl Ord for Package
impl Ord for Package
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Package
impl PartialOrd for Package
impl StructuralPartialEq for Package
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnsafeUnpin for Package
impl UnwindSafe for Package
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