pub struct MemoryStorage { /* private fields */ }
Expand description
A storage backend that holds all data in memory.
It serves as a reference implementation for storage backends as well as a test platform for the server itself. It is optimized for simplicity and readability, and is not intended for production use.
It may be used for small-scale production applications where persistence is not required and the amount of data is small enough to fit in memory.
Implementations§
Source§impl MemoryStorage
impl MemoryStorage
Trait Implementations§
Source§impl Clone for MemoryStorage
impl Clone for MemoryStorage
Source§fn clone(&self) -> MemoryStorage
fn clone(&self) -> MemoryStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MemoryStorage
impl Debug for MemoryStorage
Source§impl Default for MemoryStorage
impl Default for MemoryStorage
Source§fn default() -> MemoryStorage
fn default() -> MemoryStorage
Returns the “default value” for a type. Read more
Source§impl Storage for MemoryStorage
impl Storage for MemoryStorage
Source§fn job_types_added<'life0, 'async_trait>(
&'life0 self,
job_types: Vec<JobType>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn job_types_added<'life0, 'async_trait>(
&'life0 self,
job_types: Vec<JobType>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add or update a job type.
Source§fn jobs_added<'life0, 'async_trait>(
&'life0 self,
new_jobs: Vec<NewJob>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn jobs_added<'life0, 'async_trait>(
&'life0 self,
new_jobs: Vec<NewJob>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist the given new jobs.
Source§fn job_added_conditionally<'life0, 'async_trait>(
&'life0 self,
_job: NewJob,
_filters: JobQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<ConditionalJobResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn job_added_conditionally<'life0, 'async_trait>(
&'life0 self,
_job: NewJob,
_filters: JobQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<ConditionalJobResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist the given job if no jobs match the filter. Read more
Source§fn jobs_cancelled<'life0, 'life1, 'async_trait>(
&'life0 self,
job_ids: &'life1 [Uuid],
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<Vec<CancelledJob>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn jobs_cancelled<'life0, 'life1, 'async_trait>(
&'life0 self,
job_ids: &'life1 [Uuid],
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<Vec<CancelledJob>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Cancel the given jobs. Read more
Source§fn executions_added<'life0, 'async_trait>(
&'life0 self,
executions: Vec<NewExecution>,
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn executions_added<'life0, 'async_trait>(
&'life0 self,
executions: Vec<NewExecution>,
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add new executions.
Source§fn executions_ready<'life0, 'life1, 'async_trait>(
&'life0 self,
execution_ids: &'life1 [Uuid],
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn executions_ready<'life0, 'life1, 'async_trait>(
&'life0 self,
execution_ids: &'life1 [Uuid],
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
An execution is ready to be executed.
Source§fn execution_assigned<'life0, 'async_trait>(
&'life0 self,
execution_id: Uuid,
executor_id: Uuid,
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execution_assigned<'life0, 'async_trait>(
&'life0 self,
execution_id: Uuid,
executor_id: Uuid,
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
An execution was assigned to an executor.
Source§fn execution_started<'life0, 'async_trait>(
&'life0 self,
execution_id: Uuid,
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execution_started<'life0, 'async_trait>(
&'life0 self,
execution_id: Uuid,
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set an execution as started.
Source§fn execution_succeeded<'life0, 'async_trait>(
&'life0 self,
execution_id: Uuid,
timestamp: SystemTime,
output_payload_json: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execution_succeeded<'life0, 'async_trait>(
&'life0 self,
execution_id: Uuid,
timestamp: SystemTime,
output_payload_json: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set an execution as succeeded.
Source§fn executions_failed<'life0, 'life1, 'async_trait>(
&'life0 self,
execution_ids: &'life1 [Uuid],
timestamp: SystemTime,
reason: String,
mark_job_inactive: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn executions_failed<'life0, 'life1, 'async_trait>(
&'life0 self,
execution_ids: &'life1 [Uuid],
timestamp: SystemTime,
reason: String,
mark_job_inactive: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Set an execution as failed, if
mark_job_unschedulable
is false
the job is not marked as unschedulable, this happens when the job
is retried.Source§fn orphan_execution_ids<'life0, 'life1, 'async_trait>(
&'life0 self,
executor_ids: &'life1 [Uuid],
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn orphan_execution_ids<'life0, 'life1, 'async_trait>(
&'life0 self,
executor_ids: &'life1 [Uuid],
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return assigned executions that are not assigned to any of
the given executor IDs.
Source§fn jobs_unschedulable<'life0, 'life1, 'async_trait>(
&'life0 self,
job_ids: &'life1 [Uuid],
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn jobs_unschedulable<'life0, 'life1, 'async_trait>(
&'life0 self,
job_ids: &'life1 [Uuid],
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mark a job as unschedulable. Read more
Source§fn pending_executions<'life0, 'async_trait>(
&'life0 self,
after: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingExecution>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pending_executions<'life0, 'async_trait>(
&'life0 self,
after: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingExecution>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Executions that are not yet ready to be executed. Read more
Source§fn ready_executions<'life0, 'async_trait>(
&'life0 self,
after: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ReadyExecution>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ready_executions<'life0, 'async_trait>(
&'life0 self,
after: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ReadyExecution>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Unassigned executions that are ready at the time of the call. Read more
Source§fn pending_jobs<'life0, 'async_trait>(
&'life0 self,
after: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingJob>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pending_jobs<'life0, 'async_trait>(
&'life0 self,
after: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingJob>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Jobs that satisfy the following conditions: Read more
Source§fn query_jobs<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
limit: usize,
order: JobQueryOrder,
filters: JobQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<JobQueryResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query_jobs<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
limit: usize,
order: JobQueryOrder,
filters: JobQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<JobQueryResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query and return a list of jobs with the given parameters. Read more
Source§fn query_job_ids<'life0, 'async_trait>(
&'life0 self,
filters: JobQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query_job_ids<'life0, 'async_trait>(
&'life0 self,
filters: JobQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query and return a list of job IDs with the given parameters.
Source§fn count_jobs<'life0, 'async_trait>(
&'life0 self,
filters: JobQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_jobs<'life0, 'async_trait>(
&'life0 self,
filters: JobQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Count the number of jobs that satisfy the given filters.
Source§fn query_job_types<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<JobType>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query_job_types<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<JobType>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query and return a list of job types with the given parameters.
Source§fn delete_jobs<'life0, 'async_trait>(
&'life0 self,
filters: JobQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_jobs<'life0, 'async_trait>(
&'life0 self,
filters: JobQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove jobs and all related data, returns the removed job IDs. Read more
Source§fn schedules_added<'life0, 'async_trait>(
&'life0 self,
schedules: Vec<NewSchedule>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn schedules_added<'life0, 'async_trait>(
&'life0 self,
schedules: Vec<NewSchedule>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist the given new schedules.
Source§fn schedule_added_conditionally<'life0, 'async_trait>(
&'life0 self,
_schedule: NewSchedule,
_filters: ScheduleQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<ConditionalScheduleResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn schedule_added_conditionally<'life0, 'async_trait>(
&'life0 self,
_schedule: NewSchedule,
_filters: ScheduleQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<ConditionalScheduleResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist the given schedule if no schedules match the filter. Read more
Source§fn schedules_cancelled<'life0, 'life1, 'async_trait>(
&'life0 self,
schedule_ids: &'life1 [Uuid],
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<Vec<CancelledSchedule>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn schedules_cancelled<'life0, 'life1, 'async_trait>(
&'life0 self,
schedule_ids: &'life1 [Uuid],
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<Vec<CancelledSchedule>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Cancel the given schedules. Read more
Source§fn schedules_unschedulable<'life0, 'life1, 'async_trait>(
&'life0 self,
schedule_ids: &'life1 [Uuid],
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn schedules_unschedulable<'life0, 'life1, 'async_trait>(
&'life0 self,
schedule_ids: &'life1 [Uuid],
timestamp: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mark the given schedules as unschedulable.
Source§fn pending_schedules<'life0, 'async_trait>(
&'life0 self,
after: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingSchedule>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pending_schedules<'life0, 'async_trait>(
&'life0 self,
after: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingSchedule>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return all pending schedules. Read more
Source§fn query_schedules<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
limit: usize,
filters: ScheduleQueryFilters,
order: ScheduleQueryOrder,
) -> Pin<Box<dyn Future<Output = Result<ScheduleQueryResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query_schedules<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
limit: usize,
filters: ScheduleQueryFilters,
order: ScheduleQueryOrder,
) -> Pin<Box<dyn Future<Output = Result<ScheduleQueryResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query and return a list of schedules with the given parameters. Read more
Source§fn query_schedule_ids<'life0, 'async_trait>(
&'life0 self,
filters: ScheduleQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query_schedule_ids<'life0, 'async_trait>(
&'life0 self,
filters: ScheduleQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query and return a list of schedule IDs with the given parameters.
Source§fn count_schedules<'life0, 'async_trait>(
&'life0 self,
filters: ScheduleQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_schedules<'life0, 'async_trait>(
&'life0 self,
filters: ScheduleQueryFilters,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Count the number of schedules that satisfy the given filters.
Source§impl StorageSnapshot for MemoryStorage
impl StorageSnapshot for MemoryStorage
Source§fn export_snapshot(&self) -> BoxStream<'static, Result<SnapshotData>>
fn export_snapshot(&self) -> BoxStream<'static, Result<SnapshotData>>
Export a snapshot of the storage.
Auto Trait Implementations§
impl Freeze for MemoryStorage
impl !RefUnwindSafe for MemoryStorage
impl Send for MemoryStorage
impl Sync for MemoryStorage
impl Unpin for MemoryStorage
impl !UnwindSafe for MemoryStorage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request