[][src]Struct cargo_edit::CrateName

pub struct CrateName<'a>(_);

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

impl<'a> Debug for CrateName<'a>[src]

Auto Trait Implementations

impl<'a> Send for CrateName<'a>

impl<'a> Sync for CrateName<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err