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§
Sourcetype Component: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync
type Component: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync
A component associated with each step.
Sourcetype StepId: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync
type StepId: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync
The step identifier.
Sourcetype StepMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync
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.
Sourcetype ProgressMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync
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.
Sourcetype CompletionMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync
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.
Sourcetype SkippedMetadata: Clone + Debug + DeserializeOwned + Serialize + Eq + Send + Sync
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.
Sourcetype Error: AsError + Debug + Send + Sync
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§
Provided Methods§
Sourcefn rust_type_info() -> Option<RustTypeInfo>
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.