pub struct InMemoryTaskStore { /* private fields */ }Expand description
Process-local task attribution for an embedded server.
Implementations§
Source§impl InMemoryTaskStore
impl InMemoryTaskStore
Sourcepub fn new() -> InMemoryTaskStore
pub fn new() -> InMemoryTaskStore
Construct an empty task table.
Sourcepub fn with_capacity(max_tasks: usize) -> InMemoryTaskStore
pub fn with_capacity(max_tasks: usize) -> InMemoryTaskStore
Construct a task table retaining at most max_tasks associations.
When full, the oldest association is removed. Zero disables process-local task attribution.
Trait Implementations§
Source§impl Debug for InMemoryTaskStore
impl Debug for InMemoryTaskStore
Source§impl Default for InMemoryTaskStore
impl Default for InMemoryTaskStore
Source§fn default() -> InMemoryTaskStore
fn default() -> InMemoryTaskStore
Returns the “default value” for a type. Read more
Source§impl TaskAttributionStore for InMemoryTaskStore
impl TaskAttributionStore for InMemoryTaskStore
Source§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 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.
Source§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 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.
Auto Trait Implementations§
impl !Freeze for InMemoryTaskStore
impl RefUnwindSafe for InMemoryTaskStore
impl Send for InMemoryTaskStore
impl Sync for InMemoryTaskStore
impl Unpin for InMemoryTaskStore
impl UnsafeUnpin for InMemoryTaskStore
impl UnwindSafe for InMemoryTaskStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more