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
impl BuildArtifact
Sourcepub fn file(path: &str, file: impl Into<PathBuf>) -> Self
pub fn file(path: &str, file: impl Into<PathBuf>) -> Self
A file on this machine, installed at path.
Sourcepub fn with_rules(self, rules: &MojangRuleset) -> Self
pub fn with_rules(self, rules: &MojangRuleset) -> Self
The same artifact, installed only where rules pass.
Sourcepub fn carrying(artifacts: Vec<Artifact>, blobs: &Blobs) -> Vec<BuildArtifact>
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.
Sourcepub fn resolve(
self,
) -> Result<(Artifact, Option<(String, BlobSource)>), BuildArtifactError>
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
impl Clone for BuildArtifact
Source§impl Debug for BuildArtifact
impl Debug for BuildArtifact
Source§impl<'de> Deserialize<'de> for BuildArtifact
impl<'de> Deserialize<'de> for BuildArtifact
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for BuildArtifact
Source§impl From<Artifact> for BuildArtifact
impl From<Artifact> for BuildArtifact
Source§impl From<BuildArtifact> for Map<String, Value>
impl From<BuildArtifact> for Map<String, Value>
Source§fn from(artifact: BuildArtifact) -> Self
fn from(artifact: BuildArtifact) -> Self
Source§impl PartialEq for BuildArtifact
impl PartialEq for BuildArtifact
Source§impl Serialize for BuildArtifact
impl Serialize for BuildArtifact
impl StructuralPartialEq for BuildArtifact
Auto Trait Implementations§
impl Freeze for BuildArtifact
impl RefUnwindSafe for BuildArtifact
impl Send for BuildArtifact
impl Sync for BuildArtifact
impl Unpin for BuildArtifact
impl UnsafeUnpin for BuildArtifact
impl UnwindSafe for BuildArtifact
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.