pub struct MemoryArtifactStore { /* private fields */ }Expand description
In-memory artifact store for testing, development, and prototyping.
Data is stored in a HashMap<Uuid, Artifact> protected by RwLock
and is lost when the process exits. Implements ArtifactStore.
Implementations§
Trait Implementations§
Source§impl ArtifactStore for MemoryArtifactStore
impl ArtifactStore for MemoryArtifactStore
Source§fn put<'life0, 'async_trait>(
&'life0 self,
artifact: Artifact,
) -> Pin<Box<dyn Future<Output = StoreResult<Artifact>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
artifact: Artifact,
) -> Pin<Box<dyn Future<Output = StoreResult<Artifact>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores an artifact and returns it with server-assigned fields.
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<Option<Artifact>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<Option<Artifact>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves an artifact by identifier, or
None if not found.Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes an artifact by identifier (idempotent).
Source§fn list_by_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<Vec<Artifact>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_by_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<Vec<Artifact>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Lists all artifacts associated with a session.
Source§fn delete_by_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_by_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes all artifacts associated with a session. Read more
Source§impl Default for MemoryArtifactStore
impl Default for MemoryArtifactStore
Source§fn default() -> MemoryArtifactStore
fn default() -> MemoryArtifactStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MemoryArtifactStore
impl !RefUnwindSafe for MemoryArtifactStore
impl Send for MemoryArtifactStore
impl Sync for MemoryArtifactStore
impl Unpin for MemoryArtifactStore
impl UnsafeUnpin for MemoryArtifactStore
impl UnwindSafe for MemoryArtifactStore
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