pub struct AgentStore<B: StorageBackend + ?Sized> { /* private fields */ }Expand description
Agent store for persistence
Implementations§
Source§impl<B: StorageBackend + ?Sized> AgentStore<B>
impl<B: StorageBackend + ?Sized> AgentStore<B>
Sourcepub fn with_prefix(backend: Arc<B>, prefix: &str) -> Self
pub fn with_prefix(backend: Arc<B>, prefix: &str) -> Self
Create with custom prefix
Sourcepub async fn save(
&self,
tenant_id: &str,
agent: &Agent,
) -> Result<(), StorageError>
pub async fn save( &self, tenant_id: &str, agent: &Agent, ) -> Result<(), StorageError>
Save an agent
Sourcepub async fn load(
&self,
tenant_id: &str,
id: Uuid,
) -> Result<Option<Agent>, StorageError>
pub async fn load( &self, tenant_id: &str, id: Uuid, ) -> Result<Option<Agent>, StorageError>
Load an agent by ID
Sourcepub async fn delete(
&self,
tenant_id: &str,
id: Uuid,
) -> Result<bool, StorageError>
pub async fn delete( &self, tenant_id: &str, id: Uuid, ) -> Result<bool, StorageError>
Delete an agent
Sourcepub async fn exists(
&self,
tenant_id: &str,
id: Uuid,
) -> Result<bool, StorageError>
pub async fn exists( &self, tenant_id: &str, id: Uuid, ) -> Result<bool, StorageError>
Check if agent exists
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for AgentStore<B>where
B: ?Sized,
impl<B> RefUnwindSafe for AgentStore<B>where
B: RefUnwindSafe + ?Sized,
impl<B> Send for AgentStore<B>where
B: ?Sized,
impl<B> Sync for AgentStore<B>where
B: ?Sized,
impl<B> Unpin for AgentStore<B>where
B: ?Sized,
impl<B> UnwindSafe for AgentStore<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