Skip to main content

Dependency

Enum Dependency 

Source
pub enum Dependency {
    Path {
        path: String,
    },
    Both {
        registry: String,
        version: String,
        git: String,
        branch: Option<String>,
        tag: Option<String>,
        rev: Option<String>,
    },
    Git {
        git: String,
        branch: Option<String>,
        tag: Option<String>,
        rev: Option<String>,
    },
    Registry {
        registry: String,
        version: String,
    },
}

Variants§

§

Path

Fields

§path: String
§

Both

A dual reference: the vcs registry is the PRIMARY, default resolution source (pinned via lex.lock), and git is a recorded mirror/fallback — used only when the registry is unreachable, or when the CLI is asked to resolve from git instead (--source git). Listed before Git/ Registry so the untagged deserializer picks it whenever all of registry + version + git are present. This is what lets a manifest carry BOTH a git and a vcs reference for the same dependency.

Fields

§registry: String
§version: String
§branch: Option<String>
§

Git

Fields

§branch: Option<String>
§

Registry

Fields

§registry: String
§version: String

Implementations§

Source§

impl Dependency

Source

pub fn validate(&self) -> Result<(), String>

Return an error if more than one of branch/tag/rev is set.

Source

pub fn registry_coord(&self) -> Option<(&str, &str)>

The vcs/registry coordinate (registry, version) if this dep resolves (by default) from a registry — both a bare Registry and the dual Both. None for pure git or path deps.

Source

pub fn git_coord(&self) -> Option<GitCoord<'_>>

The git coordinate (git, branch, tag, rev) this dep carries — the sole source for a pure Git, or the recorded fallback mirror on a dual Both. None for registry-only or path deps.

Trait Implementations§

Source§

impl Debug for Dependency

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Dependency

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.