pub struct SessionsService { /* private fields */ }Expand description
Hosts the cross-window SessionsRegistry as a DaemonService.
Implementations§
Source§impl SessionsService
impl SessionsService
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates the service with an empty registry. Cheap — no I/O and no task;
the daemon calls start_watcher to begin the
transcript watcher, while tests use the bare service.
Sourcepub fn start_watcher(&self)
pub fn start_watcher(&self)
Starts the engine-owned transcript watcher (Feed 2): a background task
that scans ~/.claude/projects/**/*.jsonl for new/growing transcripts and
feeds the registry, so a session started before the daemon — or working
through the hook-silent thinking window — is still discovered and marked
active. Idempotent, and a no-op outside a tokio runtime (mirroring the
worktrees menu-refresh and Snowflake keep-alive tasks), so unit tests that
build a bare service start no watcher.
Trait Implementations§
Source§impl DaemonService for SessionsService
impl DaemonService for SessionsService
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable identifier used to route control-socket envelopes to this service
(the envelope’s
service field) and to label its status/menu.Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
op: &'life1 str,
payload: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
op: &'life1 str,
payload: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handles an operation routed to this service, returning a JSON payload.
Source§fn subscribe(
&self,
op: &str,
_payload: &Value,
) -> Option<Box<dyn ServiceStream>>
fn subscribe( &self, op: &str, _payload: &Value, ) -> Option<Box<dyn ServiceStream>>
Opens a push subscription for a streaming op, or returns
None when
op is not one this service streams (the default for every service). Read moreCheap snapshot of the service’s tray submenu, polled by the menu-bar
shell. Must not block.
Performs a tray menu action previously surfaced by
menu,
identified by its MenuAction::id.Auto Trait Implementations§
impl !Freeze for SessionsService
impl !RefUnwindSafe for SessionsService
impl !UnwindSafe for SessionsService
impl Send for SessionsService
impl Sync for SessionsService
impl Unpin for SessionsService
impl UnsafeUnpin for SessionsService
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