pub struct ContextStore<B: StorageBackend + ?Sized> { /* private fields */ }Expand description
Context store for persistence
Implementations§
Source§impl<B: StorageBackend + ?Sized> ContextStore<B>
impl<B: StorageBackend + ?Sized> ContextStore<B>
Sourcepub async fn save(
&self,
tenant_id: &str,
packet: &ContextPacket,
) -> Result<Uuid, StorageError>
pub async fn save( &self, tenant_id: &str, packet: &ContextPacket, ) -> Result<Uuid, StorageError>
Save a context packet
Sourcepub async fn load(
&self,
tenant_id: &str,
id: Uuid,
) -> Result<Option<ContextPacket>, StorageError>
pub async fn load( &self, tenant_id: &str, id: Uuid, ) -> Result<Option<ContextPacket>, StorageError>
Load a context by ID
Sourcepub async fn load_by_agent(
&self,
tenant_id: &str,
agent_id: Uuid,
) -> Result<Vec<ContextPacket>, StorageError>
pub async fn load_by_agent( &self, tenant_id: &str, agent_id: Uuid, ) -> Result<Vec<ContextPacket>, StorageError>
Load all contexts for an agent
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for ContextStore<B>where
B: ?Sized,
impl<B> RefUnwindSafe for ContextStore<B>where
B: RefUnwindSafe + ?Sized,
impl<B> Send for ContextStore<B>where
B: ?Sized,
impl<B> Sync for ContextStore<B>where
B: ?Sized,
impl<B> Unpin for ContextStore<B>where
B: ?Sized,
impl<B> UnwindSafe for ContextStore<B>where
B: RefUnwindSafe + ?Sized,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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