pub enum ArtifactOp {
Publish {
name: String,
mime_type: String,
},
Save {
name: String,
},
Load {
name: String,
},
List,
Delete {
name: String,
},
Version {
name: String,
version: u32,
},
AsJson {
name: String,
},
AsText {
name: String,
},
FromJson {
name: String,
data: String,
},
FromText {
name: String,
data: String,
},
When {
predicate: Arc<dyn Fn() -> bool + Send + Sync>,
inner: Box<ArtifactOp>,
},
Sequence(Vec<ArtifactOp>),
}Expand description
A runtime artifact operation.
These represent deferred operations on artifacts that can be composed
into pipelines using the + operator.
Variants§
Publish
Publish an artifact with a given MIME type.
Save
Save an artifact to storage.
Load
Load an artifact from storage.
List
List available artifacts.
Delete
Delete an artifact.
Version
Get a specific version of an artifact.
AsJson
Convert an artifact to JSON format.
AsText
Convert an artifact to text format.
FromJson
Create an artifact from a JSON string.
FromText
Create an artifact from a text string.
When
Conditional operation — execute inner only when predicate is true.
Fields
inner: Box<ArtifactOp>Inner operation to conditionally execute.
Sequence(Vec<ArtifactOp>)
A sequence of operations composed with +.
Implementations§
Source§impl ArtifactOp
impl ArtifactOp
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
Returns the artifact name associated with this operation, if any.
Sourcepub fn should_execute(&self) -> bool
pub fn should_execute(&self) -> bool
Returns true if this operation should execute (always true unless When).
Sourcepub fn flatten(&self) -> Vec<&ArtifactOp>
pub fn flatten(&self) -> Vec<&ArtifactOp>
Flatten this operation into a list of leaf operations.
Trait Implementations§
Source§impl Add for ArtifactOp
Compose two artifact operations with +.
impl Add for ArtifactOp
Compose two artifact operations with +.
Source§type Output = ArtifactOp
type Output = ArtifactOp
+ operator.Source§impl Clone for ArtifactOp
impl Clone for ArtifactOp
Source§fn clone(&self) -> ArtifactOp
fn clone(&self) -> ArtifactOp
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more