pub struct ArchivalAgent { /* private fields */ }Expand description
Autonomous session archival agent
Implementations§
Source§impl ArchivalAgent
impl ArchivalAgent
Sourcepub fn with_policies(policies: Vec<ArchivalPolicy>) -> Self
pub fn with_policies(policies: Vec<ArchivalPolicy>) -> Self
Create with custom policies
Sourcepub fn with_database(self, db: Arc<ChatDatabase>) -> Self
pub fn with_database(self, db: Arc<ChatDatabase>) -> Self
Set database reference
Sourcepub async fn add_policy(&self, policy: ArchivalPolicy)
pub async fn add_policy(&self, policy: ArchivalPolicy)
Add a policy
Sourcepub async fn remove_policy(&self, name: &str) -> bool
pub async fn remove_policy(&self, name: &str) -> bool
Remove a policy by name
Sourcepub async fn get_policies(&self) -> Vec<ArchivalPolicy>
pub async fn get_policies(&self) -> Vec<ArchivalPolicy>
Get all policies
Sourcepub async fn scan_candidates(&self) -> Vec<ArchivalCandidate>
pub async fn scan_candidates(&self) -> Vec<ArchivalCandidate>
Scan for archival candidates
Sourcepub async fn evaluate_session(&self, session_id: &str) -> ArchivalDecision
pub async fn evaluate_session(&self, session_id: &str) -> ArchivalDecision
Evaluate a session for archival
Sourcepub async fn archive_session(&self, _session_id: &str) -> Result<bool, String>
pub async fn archive_session(&self, _session_id: &str) -> Result<bool, String>
Archive a single session
Sourcepub async fn run(&self) -> ArchivalResult
pub async fn run(&self) -> ArchivalResult
Run the archival agent
Sourcepub async fn get_stats(&self) -> ArchivalStats
pub async fn get_stats(&self) -> ArchivalStats
Get agent statistics
Sourcepub async fn get_last_run(&self) -> Option<DateTime<Utc>>
pub async fn get_last_run(&self) -> Option<DateTime<Utc>>
Get last run time
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if agent is running
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArchivalAgent
impl !RefUnwindSafe for ArchivalAgent
impl !Send for ArchivalAgent
impl !Sync for ArchivalAgent
impl Unpin for ArchivalAgent
impl UnsafeUnpin for ArchivalAgent
impl !UnwindSafe for ArchivalAgent
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> 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