Struct PackageName
pub struct PackageName(/* private fields */);Expand description
Validated package name metadata.
Implementations§
§impl PackageName
impl PackageName
pub fn new(input: &str) -> Result<PackageName, PackageJsonTextError>
pub fn new(input: &str) -> Result<PackageName, PackageJsonTextError>
Creates lightly validated package name metadata.
§Errors
Returns PackageJsonTextError when input is empty, contains whitespace, or has an invalid scoped shape.
Trait Implementations§
§impl Clone for PackageName
impl Clone for PackageName
§fn clone(&self) -> PackageName
fn clone(&self) -> PackageName
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 more§impl Debug for PackageName
impl Debug for PackageName
§impl Display for PackageName
impl Display for PackageName
§impl FromStr for PackageName
impl FromStr for PackageName
§type Err = PackageJsonTextError
type Err = PackageJsonTextError
The associated error which can be returned from parsing.
§fn from_str(input: &str) -> Result<PackageName, <PackageName as FromStr>::Err>
fn from_str(input: &str) -> Result<PackageName, <PackageName as FromStr>::Err>
Parses a string
s to return a value of this type. Read more§impl Hash for PackageName
impl Hash for PackageName
§impl Ord for PackageName
impl Ord for PackageName
§impl PartialEq for PackageName
impl PartialEq for PackageName
§impl PartialOrd for PackageName
impl PartialOrd for PackageName
§impl TryFrom<&str> for PackageName
impl TryFrom<&str> for PackageName
§type Error = PackageJsonTextError
type Error = PackageJsonTextError
The type returned in the event of a conversion error.
§fn try_from(
value: &str,
) -> Result<PackageName, <PackageName as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<PackageName, <PackageName as TryFrom<&str>>::Error>
Performs the conversion.
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 UnsafeUnpin 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