Skip to main content

BuildArtifact

Struct BuildArtifact 

Source
pub struct BuildArtifact { /* private fields */ }
Expand description

An artifact as a plugin hands it over: a manifest’s own, except that its source may also say where the bytes are on this machine — { file }, or { bytes } a plugin made.

A manifest cannot say either, so neither outlives the build: resolve reads the bytes, and what comes back is an Artifact that names them as a blob, with the bytes beside it for whoever writes the bundle. There is no table for a plugin to keep and no id for it to compute.

Everything but the source is kept as written and decoded by the manifest’s own reader when the artifact is resolved, so a build-time artifact has no second spelling of rules, extract or anything else.

Implementations§

Source§

impl BuildArtifact

Source

pub fn file(path: &str, file: impl Into<PathBuf>) -> Self

A file on this machine, installed at path.

Source

pub fn bytes(path: &str, bytes: Vec<u8>) -> Self

Bytes a plugin made, installed at path.

Source

pub fn with_rules(self, rules: &MojangRuleset) -> Self

The same artifact, installed only where rules pass.

Source

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

Where it is installed, as written.

Source

pub fn carrying(artifacts: Vec<Artifact>, blobs: &Blobs) -> Vec<BuildArtifact>

Artifacts that name blobs, with the bytes of each put back on the artifact itself. For a producer that has already hashed what it carries and holds the two apart.

Source

pub fn resolve( self, ) -> Result<(Artifact, Option<(String, BlobSource)>), BuildArtifactError>

The manifest’s artifact, and — for one that is carried — the id of its blob and where the bytes are. The one impure step: a file is read to be named by its content.

Trait Implementations§

Source§

impl Clone for BuildArtifact

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 BuildArtifact

Source§

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

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

impl<'de> Deserialize<'de> for BuildArtifact

Source§

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

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for BuildArtifact

Source§

impl From<Artifact> for BuildArtifact

Source§

fn from(artifact: Artifact) -> Self

Converts to this type from the input type.
Source§

impl From<BuildArtifact> for Map<String, Value>

Source§

fn from(artifact: BuildArtifact) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for BuildArtifact

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 BuildArtifact

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

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

impl StructuralPartialEq for BuildArtifact

Source§

impl TryFrom<Map<String, Value>> for BuildArtifact

Source§

type Error = BuildArtifactError

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

fn try_from(fields: Map<String, Value>) -> Result<Self, Self::Error>

Performs the conversion.

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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

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

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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.