pub struct GoModulePath(/* private fields */);Expand description
Validated Go module path metadata.
Implementations§
Source§impl GoModulePath
impl GoModulePath
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, GoModuleError>
pub fn new(value: impl AsRef<str>) -> Result<Self, 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.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the path and returns the owned text.
Trait Implementations§
Source§impl AsRef<str> for GoModulePath
impl AsRef<str> for GoModulePath
Source§impl Clone for GoModulePath
impl Clone for GoModulePath
Source§fn clone(&self) -> GoModulePath
fn clone(&self) -> GoModulePath
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 GoModulePath
impl Debug for GoModulePath
Source§impl Display for GoModulePath
impl Display for GoModulePath
Source§impl FromStr for GoModulePath
impl FromStr for GoModulePath
Source§impl Hash for GoModulePath
impl Hash for GoModulePath
Source§impl Ord for GoModulePath
impl Ord for GoModulePath
Source§fn cmp(&self, other: &GoModulePath) -> Ordering
fn cmp(&self, other: &GoModulePath) -> 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 GoModulePath
impl PartialEq for GoModulePath
Source§fn eq(&self, other: &GoModulePath) -> bool
fn eq(&self, other: &GoModulePath) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for GoModulePath
impl PartialOrd for GoModulePath
Source§impl TryFrom<&str> for GoModulePath
impl TryFrom<&str> for GoModulePath
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