pub struct SessionWatcher { /* private fields */ }Expand description
Watches for session file changes and imports new messages.
Tracks the byte position in each file to enable incremental reading, avoiding the need to re-parse entire files on each modification.
Implementations§
Source§impl SessionWatcher
impl SessionWatcher
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Creates a new SessionWatcher.
Uses the default watcher registry to determine which directories to watch for session files.
§Errors
Returns an error if the database configuration cannot be created.
Sourcepub fn watch_dirs(&self) -> &[PathBuf]
pub fn watch_dirs(&self) -> &[PathBuf]
Returns the directories being watched.
This method is part of the public API for status reporting and may be used by CLI commands in the future.
Sourcepub async fn watch(
&mut self,
stats: Arc<RwLock<DaemonStats>>,
shutdown_rx: Receiver<()>,
) -> Result<()>
pub async fn watch( &mut self, stats: Arc<RwLock<DaemonStats>>, shutdown_rx: Receiver<()>, ) -> Result<()>
Sourcepub fn tracked_file_count(&self) -> usize
pub fn tracked_file_count(&self) -> usize
Returns the number of files currently being tracked.
This method is part of the public API for status reporting and is used by tests.
Auto Trait Implementations§
impl Freeze for SessionWatcher
impl RefUnwindSafe for SessionWatcher
impl Send for SessionWatcher
impl Sync for SessionWatcher
impl Unpin for SessionWatcher
impl UnwindSafe for SessionWatcher
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