Skip to main content

ResultStoreContext

Trait ResultStoreContext 

Source
pub trait ResultStoreContext {
    // Required methods
    fn publish_result(
        &self,
        key: impl Into<String> + Send,
        value: impl Serialize + Send,
        tags: Vec<String>,
    ) -> impl Future<Output = Result<SharedResult>> + Send;
    fn get_result(
        &self,
        key: &str,
    ) -> impl Future<Output = Option<SharedResult>> + Send;
    fn get_result_typed<T: for<'de> Deserialize<'de>>(
        &self,
        key: &str,
    ) -> impl Future<Output = Result<T>> + Send;
}
Expand description

Extension trait for SubTaskContext to integrate with ResultStore

Required Methods§

Source

fn publish_result( &self, key: impl Into<String> + Send, value: impl Serialize + Send, tags: Vec<String>, ) -> impl Future<Output = Result<SharedResult>> + Send

Publish a result to the shared store

Source

fn get_result( &self, key: &str, ) -> impl Future<Output = Option<SharedResult>> + Send

Get a result from the shared store

Source

fn get_result_typed<T: for<'de> Deserialize<'de>>( &self, key: &str, ) -> impl Future<Output = Result<T>> + Send

Get a typed result from the shared store

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§