[][src]Struct bindle::Invoice

pub struct Invoice {
    pub bindle_version: String,
    pub yanked: Option<bool>,
    pub bindle: BindleSpec,
    pub annotations: Option<BTreeMap<String, String>>,
    pub parcel: Option<Vec<Parcel>>,
    pub group: Option<Vec<Group>>,
}

The main structure for a Bindle invoice.

The invoice describes a specific version of a bindle. For example, the bindle foo/bar/1.0.0 would be represented as an Invoice with the BindleSpec name set to foo/bar and version set to 1.0.0.

Most fields on this struct are singular to best represent the specification. There, fields like group and parcel are singular due to the conventions of TOML.

Fields

bindle_version: Stringyanked: Option<bool>bindle: BindleSpecannotations: Option<BTreeMap<String, String>>parcel: Option<Vec<Parcel>>group: Option<Vec<Group>>

Implementations

impl Invoice[src]

pub fn name(&self) -> String[src]

produce a slash-delimited "invoice name"

For example, an invoice with the bindle name "hello" and the bindle version "1.2.3" will produce "hello/1.2.3"

pub fn canonical_name(&self) -> String[src]

Creates a standard name for an invoice

This is designed to create a repeatable opaque name for the invoice We don't typically want to have a bindle ID using its name and version number. This would impose both naming constraints on the bindle and security issues on the storage layout. So this function hashes the name/version data (which together MUST be unique in the system) and uses the resulting hash as the canonical name. The hash is guaranteed to be in the character set [a-zA-Z0-9].

Trait Implementations

impl Clone for Invoice[src]

impl Debug for Invoice[src]

impl<'de> Deserialize<'de> for Invoice[src]

impl Serialize for Invoice[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,