pub struct WatchService { /* private fields */ }Implementations§
Source§impl WatchService
impl WatchService
pub fn new( db: Arc<Mutex<Database>>, config: Arc<Config>, provider_configs: Arc<Vec<(String, PathBuf)>>, ) -> Self
pub fn watch_session(&self, session_id: &str) -> Result<StreamHandle>
pub fn watch_provider(&self, provider_name: &str) -> Result<MonitorBuilder>
pub fn watch_all_providers(&self) -> Result<MonitorBuilder>
pub fn config(&self) -> &Config
pub fn database(&self) -> Arc<Mutex<Database>>
Sourcepub fn find_most_recent_provider(
&self,
project_root: Option<&Path>,
) -> Option<String>
pub fn find_most_recent_provider( &self, project_root: Option<&Path>, ) -> Option<String>
Find the provider with the most recently updated session.
If project_root is specified, only sessions from that project are considered.
Otherwise, searches across all projects.
Returns the provider name with the most recent session, or None if no sessions found.
§Design Rationale
- Watch mode needs real-time detection of “most recently updated” sessions
- Cannot rely on DB indexing since watch bypasses DB for real-time monitoring
- Directly scans filesystem using LogDiscovery::scan_sessions()
- Uses SessionIndex.latest_mod_time (file modification time) instead of timestamp (creation time)
- This enables switching to sessions that are actively being updated, even if created earlier
- Filters by project_root to ensure watch attaches to sessions in the current project only
Trait Implementations§
Source§impl Clone for WatchService
impl Clone for WatchService
Source§fn clone(&self) -> WatchService
fn clone(&self) -> WatchService
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 WatchService
impl RefUnwindSafe for WatchService
impl Send for WatchService
impl Sync for WatchService
impl Unpin for WatchService
impl UnwindSafe for WatchService
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