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