pub struct ContextRepository { /* private fields */ }Implementations§
Source§impl ContextRepository
impl ContextRepository
pub async fn create_context( &self, user_id: &UserId, session_id: Option<&SessionId>, name: &str, ) -> Result<ContextId, RepositoryError>
pub async fn validate_context_ownership( &self, context_id: &ContextId, user_id: &UserId, ) -> Result<(), RepositoryError>
pub async fn update_context_name( &self, context_id: &ContextId, user_id: &UserId, name: &str, ) -> Result<(), RepositoryError>
pub async fn delete_context( &self, context_id: &ContextId, user_id: &UserId, ) -> Result<(), RepositoryError>
Source§impl ContextRepository
impl ContextRepository
pub async fn find_user_id_for_context( &self, context_id: &ContextId, ) -> Result<Option<UserId>, RepositoryError>
pub async fn get_context( &self, context_id: &ContextId, user_id: &UserId, ) -> Result<UserContext, RepositoryError>
pub async fn list_contexts_basic( &self, user_id: &UserId, ) -> Result<Vec<UserContext>, RepositoryError>
pub async fn list_contexts_with_stats( &self, user_id: &UserId, ) -> Result<Vec<UserContextWithStats>, RepositoryError>
pub async fn find_by_session_id( &self, session_id: &SessionId, ) -> Result<Option<UserContext>, RepositoryError>
pub async fn get_context_events_since( &self, context_id: &ContextId, last_seen: DateTime<Utc>, ) -> Result<Vec<ContextStateEvent>, RepositoryError>
Source§impl ContextRepository
impl ContextRepository
pub fn new(db: &DbPool) -> Result<Self, AgentError>
Trait Implementations§
Source§impl Clone for ContextRepository
impl Clone for ContextRepository
Source§fn clone(&self) -> ContextRepository
fn clone(&self) -> ContextRepository
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ContextRepository
impl !UnwindSafe for ContextRepository
impl Freeze for ContextRepository
impl Send for ContextRepository
impl Sync for ContextRepository
impl Unpin for ContextRepository
impl UnsafeUnpin for ContextRepository
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> 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