pub struct PackageName(/* private fields */);Expand description
A non-empty package name such as DIP-8, SOIC-16, TO-220, or 0603.
Implementations§
Source§impl PackageName
impl PackageName
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, PackageNameError>
pub fn new(value: impl AsRef<str>) -> Result<Self, PackageNameError>
Creates a package name from non-empty text.
§Errors
Returns PackageNameError::Empty when the trimmed value is empty.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the package name and returns the owned string.
Trait Implementations§
Source§impl AsRef<str> for PackageName
impl AsRef<str> for PackageName
Source§impl Clone for PackageName
impl Clone for PackageName
Source§fn clone(&self) -> PackageName
fn clone(&self) -> PackageName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FromStr for PackageName
impl FromStr for PackageName
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 (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
Source§impl PartialEq for PackageName
impl PartialEq for PackageName
Source§fn eq(&self, other: &PackageName) -> bool
fn eq(&self, other: &PackageName) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PackageName
impl PartialOrd 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 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