[][src]Struct rvn::MavenCoordinates

pub struct MavenCoordinates<'a> {
    pub group_id: &'a str,
    pub artifact_id: &'a str,
    pub packaging: Option<&'a str>,
    pub classifier: Option<&'a str>,
    pub version: &'a str,

A parsed Maven coordinates record.


group_id: &'a strartifact_id: &'a strpackaging: Option<&'a str>classifier: Option<&'a str>version: &'a str


impl<'a> MavenCoordinates<'a>[src]

pub fn new(
    group_id: &'a str,
    artifact_id: &'a str,
    packaging: Option<&'a str>,
    classifier: Option<&'a str>,
    version: &'a str
) -> MavenCoordinates<'a>

Constructs a new, empty MavenCoordinates


use rvn::MavenCoordinates;

let coordinates = MavenCoordinates::new("com.fasterxml.jackson.core", "jackson-annotations", None, None, "2.9.9");

pub fn parse(maven_coordinates: &str) -> Result<MavenCoordinates, &'static str>[src]

Parse the Maven coordinates from a string.


use rvn::MavenCoordinates;

let coordinates = MavenCoordinates::parse("com.fasterxml.jackson.core:jackson-annotations:2.9.9").unwrap();

pub fn fetch_checksum(
    repository: &Url,
    algorithm: Algorithm
) -> Result<Checksum, Error>

Fetch the checksum associated with the Maven coordinates.


use rvn::{MavenCoordinates};
use rvn::checksum::Algorithm;
use url::Url;

let repository = Url::parse("https://repo1.maven.org/maven2").unwrap();
let coordinates = MavenCoordinates::parse("com.fasterxml.jackson.core:jackson-annotations:jar:sources:2.9.9").unwrap();
let checksum = coordinates.fetch_checksum(&repository, Algorithm::Sha1).unwrap();

assert_eq!(checksum.value, "4ac77aa5799fcf00a9cde00cd7da4d08bdc038ff");
assert_eq!(checksum.algorithm, Algorithm::Sha1);

Trait Implementations

impl<'a> Eq for MavenCoordinates<'a>[src]

impl<'a> Clone for MavenCoordinates<'a>[src]

impl<'a> PartialEq<MavenCoordinates<'a>> for MavenCoordinates<'a>[src]

impl<'_> Display for MavenCoordinates<'_>[src]

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

Auto Trait Implementations

impl<'a> Unpin for MavenCoordinates<'a>

impl<'a> Sync for MavenCoordinates<'a>

impl<'a> Send for MavenCoordinates<'a>

impl<'a> UnwindSafe for MavenCoordinates<'a>

impl<'a> RefUnwindSafe for MavenCoordinates<'a>

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T> Borrow<T> for T where
    T: ?Sized

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized

impl<T> Erased for T

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

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