pub struct PackName(/* private fields */);Expand description
A pack’s name, @scope/name.
Implementations§
Source§impl PackName
impl PackName
Sourcepub fn new(text: impl Into<String>) -> Result<Self, Invalid>
pub fn new(text: impl Into<String>) -> Result<Self, Invalid>
The name text, when it is one: @, a scope, / and a name, each part lowercase letters, digits, -, .,
_ and ~, not starting with . or _, as npm names scoped packages; at most 214 characters.
§Errors
Invalid::Name when it isn’t one.
Sourcepub fn is_reserved(&self) -> bool
pub fn is_reserved(&self) -> bool
Whether it is in the scope the spec reserves, @compmd/.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PackName
impl<'de> Deserialize<'de> for PackName
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PackName
Source§impl Ord for PackName
impl Ord for PackName
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 PackName
impl PartialOrd for PackName
impl StructuralPartialEq for PackName
Auto Trait Implementations§
impl Forget for PackName
impl Freeze for PackName
impl Move for PackName
impl RefUnwindSafe for PackName
impl Send for PackName
impl Sync for PackName
impl Unpin for PackName
impl UnsafeUnpin for PackName
impl UnwindSafe for PackName
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