pub struct MemoryStore { /* private fields */ }
Expand description

An in-memory store for Ora.

Implementations§

source§

impl MemoryStore

source

pub fn new() -> Self

Creates a new MemoryStore.

source

pub fn new_with_options(options: MemoryStoreOptions) -> Self

Creates a new MemoryStore with the given options.

Trait Implementations§

source§

impl ClientOperations for MemoryStore

source§

fn add_task<'life0, 'async_trait>( &'life0 self, task: TaskDefinition ) -> Pin<Box<dyn Future<Output = Result<Uuid>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn task<'life0, 'async_trait>( &'life0 self, task_id: Uuid ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn TaskOperations>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn tasks<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Tasks ) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<dyn TaskOperations>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn task_count<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Tasks ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn task_labels<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn task_kinds<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn add_schedule<'life0, 'async_trait>( &'life0 self, schedule: ScheduleDefinition ) -> Pin<Box<dyn Future<Output = Result<Uuid>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn schedule<'life0, 'async_trait>( &'life0 self, schedule_id: Uuid ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ScheduleOperations>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn schedules<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Schedules ) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<dyn ScheduleOperations>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn schedule_count<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Schedules ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn schedule_labels<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn add_tasks<'life0, 'life1, 'async_trait>( &'life0 self, tasks: &'life1 mut (dyn ExactSizeIterator<Item = TaskDefinition<()>> + Send) ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid, Global>, Report>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

source§

fn cancel_tasks<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Tasks ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid, Global>, Report>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

source§

fn tasks_by_ids<'life0, 'async_trait>( &'life0 self, task_ids: Vec<Uuid, Global> ) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<dyn TaskOperations, Global>, Global>, Report>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

source§

fn add_schedules<'life0, 'life1, 'async_trait>( &'life0 self, schedules: &'life1 mut (dyn ExactSizeIterator<Item = ScheduleDefinition> + Send) ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid, Global>, Report>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

source§

fn schedules_by_ids<'life0, 'async_trait>( &'life0 self, schedule_ids: Vec<Uuid, Global> ) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<dyn ScheduleOperations, Global>, Global>, Report>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

source§

fn cancel_schedules<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Schedules ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid, Global>, Report>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

source§

impl Clone for MemoryStore

source§

fn clone(&self) -> MemoryStore

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MemoryStore

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MemoryStore

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl SchedulerScheduleStore for MemoryStore

§

type Error = Error

An error type returned by operations.
§

type Events = Pin<Box<dyn Stream<Item = Result<SchedulerScheduleStoreEvent, <MemoryStore as SchedulerScheduleStore>::Error>> + Send, Global>>

An event stream that can be used to watch for changes.
source§

fn events<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Self::Events, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Subscribe for new events.
source§

fn pending_schedules<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveSchedule>, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Return all schedules that have no associated active tasks.
source§

fn pending_schedule_of_task<'life0, 'async_trait>( &'life0 self, task_id: Uuid ) -> Pin<Box<dyn Future<Output = Result<Option<ActiveSchedule>, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Return the schedule of a task only if the schedule has no associated active tasks.
source§

fn add_task<'life0, 'async_trait>( &'life0 self, schedule_id: Uuid, task: TaskDefinition ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Add a new active task for a schedule.
source§

fn task_target<'life0, 'async_trait>( &'life0 self, task_id: Uuid ) -> Pin<Box<dyn Future<Output = Result<UnixNanos, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Return the target time of a task.
source§

impl SchedulerTaskStore for MemoryStore

§

type Error = Error

An error type returned by operations.
§

type Events = Pin<Box<dyn Stream<Item = Result<SchedulerTaskStoreEvent, <MemoryStore as SchedulerTaskStore>::Error>> + Send, Global>>

An event stream that can be used to watch for changes.
source§

fn events<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Self::Events, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Subscribe for new events.
source§

fn pending_tasks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<PendingTask>, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Return all tasks that should be scheduled.
source§

fn active_tasks<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveTask>, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Return active tasks that are not pending and are not yet finished. Read more
source§

fn task_ready<'life0, 'async_trait>( &'life0 self, task_id: Uuid ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Update the task status as ready.
source§

fn task_timed_out<'life0, 'async_trait>( &'life0 self, task_id: Uuid ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

The task timed out. Read more
source§

impl WorkerStore for MemoryStore

§

type Error = Error

An error type returned by operations.
§

type Events = Pin<Box<dyn Stream<Item = Result<WorkerStoreEvent, <MemoryStore as WorkerStore>::Error>> + Send, Global>>

An event stream that can be used to watch for changes.
source§

fn events<'life0, 'life1, 'async_trait>( &'life0 self, selectors: &'life1 [WorkerSelector] ) -> Pin<Box<dyn Future<Output = Result<Self::Events, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Subscribe for new events with the given worker selectors.
source§

fn ready_tasks<'life0, 'life1, 'async_trait>( &'life0 self, selectors: &'life1 [WorkerSelector] ) -> Pin<Box<dyn Future<Output = Result<Vec<ReadyTask>, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return all tasks that should be executed with any of the given worker selectors.
source§

fn select_task<'life0, 'async_trait>( &'life0 self, task_id: Uuid, worker_id: Uuid ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Select a task to run, if this function returns false, the worker should drop the task instead of running it. Read more
source§

fn task_started<'life0, 'async_trait>( &'life0 self, task_id: Uuid ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Update the task status as started.
source§

fn task_succeeded<'life0, 'async_trait>( &'life0 self, task_id: Uuid, output: Vec<u8>, output_format: TaskDataFormat ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Update the task status as successful with the given output.
source§

fn task_failed<'life0, 'async_trait>( &'life0 self, task_id: Uuid, reason: String ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Update the task status as failed with the given reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more