Skip to main content

EngineSpec

Trait EngineSpec 

Source
pub trait EngineSpec: Send + 'static {
    type Component: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync;
    type StepId: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync;
    type StepMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync;
    type ProgressMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync;
    type CompletionMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync;
    type SkippedMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync;
    type Error: AsError + Debug + Send + Sync;

    // Required method
    fn spec_name() -> String;

    // Provided method
    fn rust_type_info() -> Option<RustTypeInfo> { ... }
}
Expand description

A specification for an UpdateEngine.

This defines the set of types required to use an UpdateEngine.

Required Associated Types§

Source

type Component: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync

A component associated with each step.

Source

type StepId: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync

The step identifier.

Source

type StepMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync

Metadata associated with each step.

This can be () if there’s no metadata associated with the step, or serde_json::Value for freeform metadata.

Source

type ProgressMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync

Metadata associated with an individual progress event.

This can be () if there’s no metadata associated with the step, or serde_json::Value for freeform metadata.

Source

type CompletionMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync

Metadata associated with each step’s completion.

This can be () if there’s no metadata associated with the step, or serde_json::Value for freeform metadata.

Source

type SkippedMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync

Metadata associated with a step being skipped.

This can be () if there’s no metadata associated with the step, or serde_json::Value for freeform metadata.

Source

type Error: AsError + Debug + Send + Sync

The error type associated with each step.

Ideally this would have a trait bound of std::error::Error; however, anyhow::Error doesn’t implement std::error::Error. Both can be converted to a dynamic Error, though. We use AsError to abstract over both sorts of errors.

Required Methods§

Source

fn spec_name() -> String

The name of this specification, used to identify it in serialized events.

Provided Methods§

Source

fn rust_type_info() -> Option<RustTypeInfo>

Information for the x-rust-type JSON Schema extension.

When this returns Some, generic types parameterized by this spec will include the x-rust-type extension in their JSON Schema, enabling automatic type replacement in typify and progenitor.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§