pub struct PackageRef {
pub scope: Option<String>,
pub name: String,
pub version: Option<String>,
}Expand description
Reference to a package in the registry.
§Format
@scope/name- Latest version@scope/name@1.2.3- Specific version@scope/name@^1.0- Version range
§Example
use spn_core::PackageRef;
let pkg = PackageRef::parse("@workflows/code-review@1.0.0").unwrap();
assert_eq!(pkg.scope, Some("workflows".to_string()));
assert_eq!(pkg.name, "code-review");
assert_eq!(pkg.version, Some("1.0.0".to_string()));Fields§
§scope: Option<String>Package scope (e.g., “workflows” from “@workflows/name”)
name: StringPackage name
version: Option<String>Version constraint
Implementations§
Source§impl PackageRef
impl PackageRef
Trait Implementations§
Source§impl Clone for PackageRef
impl Clone for PackageRef
Source§fn clone(&self) -> PackageRef
fn clone(&self) -> PackageRef
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 PackageRef
impl Debug for PackageRef
Source§impl PartialEq for PackageRef
impl PartialEq for PackageRef
impl Eq for PackageRef
impl StructuralPartialEq for PackageRef
Auto Trait Implementations§
impl Freeze for PackageRef
impl RefUnwindSafe for PackageRef
impl Send for PackageRef
impl Sync for PackageRef
impl Unpin for PackageRef
impl UnsafeUnpin for PackageRef
impl UnwindSafe for PackageRef
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