pub struct InMemoryStorage { /* private fields */ }Expand description
In-memory storage implementation.
Suitable for development and testing. Not recommended for production as data is lost when the process terminates.
Implementations§
Trait Implementations§
Source§impl Debug for InMemoryStorage
impl Debug for InMemoryStorage
Source§impl Default for InMemoryStorage
impl Default for InMemoryStorage
Source§fn default() -> InMemoryStorage
fn default() -> InMemoryStorage
Returns the “default value” for a type. Read more
Source§impl Storage for InMemoryStorage
impl Storage for InMemoryStorage
Source§fn get_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a task by ID.
Source§fn save_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save a new task.
Source§fn update_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update an existing task.
Source§fn delete_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a task.
Auto Trait Implementations§
impl Freeze for InMemoryStorage
impl !RefUnwindSafe for InMemoryStorage
impl Send for InMemoryStorage
impl Sync for InMemoryStorage
impl Unpin for InMemoryStorage
impl !UnwindSafe for InMemoryStorage
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