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