[−][src]Struct cargo_edit::CrateName
A crate specifier. This can be a plain name (e.g. docopt
), a name and a versionreq (e.g.
docopt@^0.8
), a URL, or a path.
Methods
impl<'a> CrateName<'a>
[src]
pub fn new(name: &'a str) -> Self
[src]
Create a new CrateName
pub fn name(&self) -> &str
[src]
Get crate name
pub fn has_version(&self) -> bool
[src]
Does this specify a versionreq?
pub fn is_url_or_path(&self) -> bool
[src]
Is this a URI?
pub fn parse_as_version(&self) -> Result<Option<Dependency>>
[src]
If this crate specifier includes a version (e.g. docopt@0.8
), extract the name and
version.
pub fn parse_crate_name_from_uri(&self) -> Result<Dependency>
[src]
Will parse this crate name on the assumption that it is a URI.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,