pub struct TaskRepository { /* private fields */ }Implementations§
Source§impl TaskRepository
impl TaskRepository
pub async fn get_next_sequence_number( &self, task_id: &TaskId, ) -> Result<i32, RepositoryError>
pub async fn get_messages_by_task( &self, task_id: &TaskId, ) -> Result<Vec<Message>, RepositoryError>
pub async fn get_message_parts( &self, message_id: &MessageId, ) -> Result<Vec<Part>, RepositoryError>
pub async fn get_messages_by_context( &self, context_id: &ContextId, ) -> Result<Vec<Message>, RepositoryError>
pub async fn get_next_sequence_number_in_tx( &self, tx: &mut dyn DatabaseTransaction, task_id: &TaskId, ) -> Result<i32, 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>
Source§impl TaskRepository
impl TaskRepository
pub async fn update_task_and_save_messages( &self, task: &Task, user_message: &Message, agent_message: &Message, user_id: Option<&UserId>, session_id: &SessionId, trace_id: &TraceId, ) -> Result<Task, RepositoryError>
pub async fn delete_task(&self, task_id: &TaskId) -> Result<(), RepositoryError>
Source§impl TaskRepository
impl TaskRepository
pub fn new(db_pool: DbPool) -> Self
pub fn with_session_analytics_provider( self, provider: DynSessionAnalyticsProvider, ) -> Self
pub fn with_file_upload_provider(self, provider: DynFileUploadProvider) -> Self
pub async fn create_task( &self, task: &Task, user_id: &UserId, session_id: &SessionId, trace_id: &TraceId, agent_name: &str, ) -> Result<String, RepositoryError>
pub async fn get_task( &self, task_id: &TaskId, ) -> Result<Option<Task>, RepositoryError>
pub async fn get_task_by_str( &self, task_id: &str, ) -> Result<Option<Task>, RepositoryError>
pub async fn list_tasks_by_context( &self, context_id: &ContextId, ) -> Result<Vec<Task>, RepositoryError>
pub async fn list_tasks_by_context_str( &self, context_id: &str, ) -> Result<Vec<Task>, RepositoryError>
pub async fn get_tasks_by_user_id( &self, user_id: &UserId, limit: Option<i32>, offset: Option<i32>, ) -> Result<Vec<Task>, RepositoryError>
pub async fn get_tasks_by_user_id_str( &self, user_id: &str, limit: Option<i32>, offset: Option<i32>, ) -> Result<Vec<Task>, RepositoryError>
pub async fn track_agent_in_context( &self, context_id: &ContextId, agent_name: &str, ) -> Result<(), RepositoryError>
pub async fn track_agent_in_context_str( &self, context_id: &str, agent_name: &str, ) -> Result<(), RepositoryError>
pub async fn update_task_state( &self, task_id: &TaskId, state: TaskState, timestamp: &DateTime<Utc>, ) -> Result<(), RepositoryError>
pub async fn update_task_state_str( &self, task_id: &str, state: TaskState, timestamp: &DateTime<Utc>, ) -> Result<(), RepositoryError>
pub async fn update_task_failed_with_error( &self, task_id: &TaskId, error_message: &str, timestamp: &DateTime<Utc>, ) -> Result<(), RepositoryError>
pub async fn get_task_context_info( &self, task_id: &TaskId, ) -> Result<Option<TaskContextInfo>, RepositoryError>
Trait Implementations§
Source§impl Clone for TaskRepository
impl Clone for TaskRepository
Source§fn clone(&self) -> TaskRepository
fn clone(&self) -> TaskRepository
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 moreSource§impl Debug for TaskRepository
impl Debug for TaskRepository
Auto Trait Implementations§
impl Freeze for TaskRepository
impl !RefUnwindSafe for TaskRepository
impl Send for TaskRepository
impl Sync for TaskRepository
impl Unpin for TaskRepository
impl !UnwindSafe for TaskRepository
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