pub struct GoPackageName(/* private fields */);Expand description
Validated Go package name metadata.
Implementations§
Source§impl GoPackageName
impl GoPackageName
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, GoPackageError>
pub fn new(value: impl AsRef<str>) -> Result<Self, GoPackageError>
Creates a package name from ASCII identifier-shaped text.
§Errors
Returns GoPackageError when the name is empty or not ASCII identifier-shaped.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the name and returns the owned text.
Trait Implementations§
Source§impl AsRef<str> for GoPackageName
impl AsRef<str> for GoPackageName
Source§impl Clone for GoPackageName
impl Clone for GoPackageName
Source§fn clone(&self) -> GoPackageName
fn clone(&self) -> GoPackageName
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 GoPackageName
impl Debug for GoPackageName
Source§impl Display for GoPackageName
impl Display for GoPackageName
Source§impl FromStr for GoPackageName
impl FromStr for GoPackageName
Source§impl Hash for GoPackageName
impl Hash for GoPackageName
Source§impl Ord for GoPackageName
impl Ord for GoPackageName
Source§fn cmp(&self, other: &GoPackageName) -> Ordering
fn cmp(&self, other: &GoPackageName) -> 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 GoPackageName
impl PartialEq for GoPackageName
Source§fn eq(&self, other: &GoPackageName) -> bool
fn eq(&self, other: &GoPackageName) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for GoPackageName
impl PartialOrd for GoPackageName
Source§impl TryFrom<&str> for GoPackageName
impl TryFrom<&str> for GoPackageName
impl Eq for GoPackageName
impl StructuralPartialEq for GoPackageName
Auto Trait Implementations§
impl Freeze for GoPackageName
impl RefUnwindSafe for GoPackageName
impl Send for GoPackageName
impl Sync for GoPackageName
impl Unpin for GoPackageName
impl UnsafeUnpin for GoPackageName
impl UnwindSafe for GoPackageName
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