pub struct GoImportPath(/* private fields */);Expand description
Validated Go import path metadata.
Implementations§
Source§impl GoImportPath
impl GoImportPath
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, GoImportError>
pub fn new(value: impl AsRef<str>) -> Result<Self, GoImportError>
Creates a Go import path from non-empty text.
§Errors
Returns GoImportError when the path is empty or contains obvious whitespace.
Sourcepub fn is_relative(&self) -> bool
pub fn is_relative(&self) -> bool
Returns whether this import path is relative.
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 GoImportPath
impl AsRef<str> for GoImportPath
Source§impl Clone for GoImportPath
impl Clone for GoImportPath
Source§fn clone(&self) -> GoImportPath
fn clone(&self) -> GoImportPath
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 GoImportPath
impl Debug for GoImportPath
Source§impl Display for GoImportPath
impl Display for GoImportPath
Source§impl FromStr for GoImportPath
impl FromStr for GoImportPath
Source§impl Hash for GoImportPath
impl Hash for GoImportPath
Source§impl Ord for GoImportPath
impl Ord for GoImportPath
Source§fn cmp(&self, other: &GoImportPath) -> Ordering
fn cmp(&self, other: &GoImportPath) -> 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 GoImportPath
impl PartialEq for GoImportPath
Source§fn eq(&self, other: &GoImportPath) -> bool
fn eq(&self, other: &GoImportPath) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for GoImportPath
impl PartialOrd for GoImportPath
Source§impl TryFrom<&str> for GoImportPath
impl TryFrom<&str> for GoImportPath
impl Eq for GoImportPath
impl StructuralPartialEq for GoImportPath
Auto Trait Implementations§
impl Freeze for GoImportPath
impl RefUnwindSafe for GoImportPath
impl Send for GoImportPath
impl Sync for GoImportPath
impl Unpin for GoImportPath
impl UnsafeUnpin for GoImportPath
impl UnwindSafe for GoImportPath
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