Struct GoPackageName
pub struct GoPackageName(/* private fields */);Expand description
Validated Go package name metadata.
Implementations§
§impl GoPackageName
impl GoPackageName
pub fn new(value: impl AsRef<str>) -> Result<GoPackageName, GoPackageError>
pub fn new(value: impl AsRef<str>) -> Result<GoPackageName, GoPackageError>
Creates a package name from ASCII identifier-shaped text.
§Errors
Returns GoPackageError when the name is empty or not ASCII identifier-shaped.
pub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the name and returns the owned text.
Trait Implementations§
§impl AsRef<str> for GoPackageName
impl AsRef<str> for GoPackageName
§impl Clone for GoPackageName
impl Clone for GoPackageName
§fn clone(&self) -> GoPackageName
fn clone(&self) -> GoPackageName
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 GoPackageName
impl Debug for GoPackageName
§impl Display for GoPackageName
impl Display for GoPackageName
§impl FromStr for GoPackageName
impl FromStr for GoPackageName
§type Err = GoPackageError
type Err = GoPackageError
The associated error which can be returned from parsing.
§fn from_str(
value: &str,
) -> Result<GoPackageName, <GoPackageName as FromStr>::Err>
fn from_str( value: &str, ) -> Result<GoPackageName, <GoPackageName as FromStr>::Err>
Parses a string
s to return a value of this type. Read more§impl Hash for GoPackageName
impl Hash for GoPackageName
§impl Ord for GoPackageName
impl Ord for GoPackageName
§impl PartialEq for GoPackageName
impl PartialEq for GoPackageName
§impl PartialOrd for GoPackageName
impl PartialOrd for GoPackageName
§impl TryFrom<&str> for GoPackageName
impl TryFrom<&str> for GoPackageName
§type Error = GoPackageError
type Error = GoPackageError
The type returned in the event of a conversion error.
§fn try_from(
value: &str,
) -> Result<GoPackageName, <GoPackageName as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<GoPackageName, <GoPackageName as TryFrom<&str>>::Error>
Performs the conversion.
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