pub trait TaskAttributionStore: Send + Sync {
// Required methods
fn insert<'a>(
&'a self,
tenant_id: &'a str,
task_id: &'a str,
attribution: TaskAttribution,
) -> Pin<Box<dyn Future<Output = Result<(), TaskStoreError>> + Send + 'a>>;
fn get<'a>(
&'a self,
tenant_id: &'a str,
task_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskAttribution>, TaskStoreError>> + Send + 'a>>;
fn claim<'a>(
&'a self,
tenant_id: &'a str,
task_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskAttribution>, TaskStoreError>> + Send + 'a>>;
fn remove<'a>(
&'a self,
tenant_id: &'a str,
task_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), TaskStoreError>> + Send + 'a>>;
}Expand description
Persists pre-priced, non-identifying attribution under a durable task ID.
Required Methods§
Sourcefn insert<'a>(
&'a self,
tenant_id: &'a str,
task_id: &'a str,
attribution: TaskAttribution,
) -> Pin<Box<dyn Future<Output = Result<(), TaskStoreError>> + Send + 'a>>
fn insert<'a>( &'a self, tenant_id: &'a str, task_id: &'a str, attribution: TaskAttribution, ) -> Pin<Box<dyn Future<Output = Result<(), TaskStoreError>> + Send + 'a>>
Associate a task with its resolved price and fixed origin category.
Sourcefn get<'a>(
&'a self,
tenant_id: &'a str,
task_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskAttribution>, TaskStoreError>> + Send + 'a>>
fn get<'a>( &'a self, tenant_id: &'a str, task_id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<TaskAttribution>, TaskStoreError>> + Send + 'a>>
Resolve an association without consuming it.
Sourcefn claim<'a>(
&'a self,
tenant_id: &'a str,
task_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskAttribution>, TaskStoreError>> + Send + 'a>>
fn claim<'a>( &'a self, tenant_id: &'a str, task_id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<TaskAttribution>, TaskStoreError>> + Send + 'a>>
Atomically consume and return an association.
A completed durable task can be returned by many later polls. Using this operation before recording usage guarantees that only one process can account for that task.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".