Skip to main content

Entry

Struct Entry 

Source
pub struct Entry {
    pub source: Source,
    pub version: Option<String>,
    pub subpath: Option<SourceSubpath>,
    pub dialect: Option<Dialect>,
    pub plugin: Option<String>,
    pub filter: FilterConfig,
    pub unknown: BTreeMap<String, Value>,
}
Expand description

One dependency entry. It serializes in the spelling of the file (url or path, version, subpath, dialect, plugin, the filter keys), so a consumer’s mars.toml writes it back as it was authored. version is a git source’s constraint; a path source has none and ignores it.

Fields§

§source: Source§version: Option<String>§subpath: Option<SourceSubpath>§dialect: Option<Dialect>

Inbound lift dialect for the package.

§plugin: Option<String>

The plugin to install from the marketplace at this source.

§filter: FilterConfig§unknown: BTreeMap<String, Value>

Keys Mars does not read here, kept so the file round-trips and a caller can warn.

Implementations§

Source§

impl Entry

Source

pub fn git(url: impl Into<String>) -> Self

A git entry with no selector, version or filter.

Source

pub fn at_path(path: impl Into<PathBuf>) -> Self

A path entry with no selector or filter.

Source

pub fn from_source(source: Source) -> Self

An entry for source with no selector, version or filter.

Source

pub fn url(&self) -> Option<&str>

The git URL, for a git entry.

Source

pub fn path(&self) -> Option<&Path>

The directory, for a path entry.

Source

pub fn read( name: &str, raw: RawEntry, strictness: Strictness, ) -> Result<(Self, Vec<EntryWarning>), EntryError>

Read an authored entry under every rule: exactly one of url and path, a bare host/path URL spelled with https:// (see crate::git_url::with_default_scheme), a plugin selector that does not contradict subpath or dialect, and a consistent filter (FilterConfig::validate). strictness decides whether a broken filter or a plugin with dialect refuses or warns; the rest refuse for every reader.

Trait Implementations§

Source§

impl Clone for Entry

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Entry

Source§

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

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

impl From<&Entry> for RawEntry

Source§

fn from(entry: &Entry) -> Self

Converts to this type from the input type.
Source§

impl From<Entry> for RawEntry

Source§

fn from(entry: Entry) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Entry

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Entry

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Entry

Auto Trait Implementations§

§

impl Freeze for Entry

§

impl RefUnwindSafe for Entry

§

impl Send for Entry

§

impl Sync for Entry

§

impl Unpin for Entry

§

impl UnsafeUnpin for Entry

§

impl UnwindSafe for Entry

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.