pub struct MessageRepository { /* private fields */ }Implementations§
Source§impl MessageRepository
impl MessageRepository
pub fn new(db_pool: DbPool) -> Result<Self, RepositoryError>
pub async fn get_messages_by_task( &self, task_id: &TaskId, ) -> Result<Vec<Message>, RepositoryError>
pub async fn get_messages_by_context( &self, context_id: &ContextId, ) -> Result<Vec<Message>, RepositoryError>
pub async fn get_next_sequence_number( &self, task_id: &TaskId, ) -> Result<i32, RepositoryError>
pub async fn persist_message_sqlx( &self, tx: &mut Transaction<'_, Postgres>, message: &Message, task_id: &TaskId, context_id: &ContextId, sequence_number: i32, user_id: Option<&UserId>, session_id: &SessionId, trace_id: &TraceId, upload_ctx: Option<&FileUploadContext<'_>>, ) -> Result<(), RepositoryError>
pub async fn persist_message_with_tx( &self, tx: &mut dyn DatabaseTransaction, message: &Message, task_id: &TaskId, context_id: &ContextId, sequence_number: i32, user_id: Option<&UserId>, session_id: &SessionId, trace_id: &TraceId, ) -> Result<(), RepositoryError>
Trait Implementations§
Source§impl Clone for MessageRepository
impl Clone for MessageRepository
Source§fn clone(&self) -> MessageRepository
fn clone(&self) -> MessageRepository
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for MessageRepository
impl !RefUnwindSafe for MessageRepository
impl Send for MessageRepository
impl Sync for MessageRepository
impl Unpin for MessageRepository
impl !UnwindSafe for MessageRepository
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,
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