pub struct GoPackagePath(/* private fields */);Expand description
Validated slash-separated Go package path metadata.
Implementations§
Source§impl GoPackagePath
impl GoPackagePath
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, GoPackageError>
pub fn new(value: impl AsRef<str>) -> Result<Self, GoPackageError>
Creates a package path from slash-separated text.
§Errors
Returns GoPackageError when the path is empty or contains empty/whitespace 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 GoPackagePath
impl AsRef<str> for GoPackagePath
Source§impl Clone for GoPackagePath
impl Clone for GoPackagePath
Source§fn clone(&self) -> GoPackagePath
fn clone(&self) -> GoPackagePath
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 GoPackagePath
impl Debug for GoPackagePath
Source§impl Display for GoPackagePath
impl Display for GoPackagePath
Source§impl FromStr for GoPackagePath
impl FromStr for GoPackagePath
Source§impl Hash for GoPackagePath
impl Hash for GoPackagePath
Source§impl Ord for GoPackagePath
impl Ord for GoPackagePath
Source§fn cmp(&self, other: &GoPackagePath) -> Ordering
fn cmp(&self, other: &GoPackagePath) -> 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 GoPackagePath
impl PartialEq for GoPackagePath
Source§fn eq(&self, other: &GoPackagePath) -> bool
fn eq(&self, other: &GoPackagePath) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for GoPackagePath
impl PartialOrd for GoPackagePath
Source§impl TryFrom<&str> for GoPackagePath
impl TryFrom<&str> for GoPackagePath
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