pub struct GithubCountersService { /* private fields */ }Expand description
Periodically logs, and reports on demand, the GitHub API-call counters.
Implementations§
Source§impl GithubCountersService
impl GithubCountersService
Sourcepub fn new() -> Self
pub fn new() -> Self
Cheap construction (like the worktrees/sessions services): captures the
start time and persists nothing. Call Self::start_counter_logger to
spawn the periodic task once inside the tokio runtime.
Sourcepub fn start_counter_logger(&self)
pub fn start_counter_logger(&self)
Spawns the ~5s-then-every-10-min summary task. Idempotent and a no-op outside a tokio runtime (unit tests), mirroring the worktrees pollers.
Trait Implementations§
Source§impl DaemonService for GithubCountersService
impl DaemonService for GithubCountersService
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.
Cheap 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.Source§fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ServiceStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ServiceStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Structured status for
daemon status aggregation.Auto Trait Implementations§
impl !Freeze for GithubCountersService
impl RefUnwindSafe for GithubCountersService
impl Send for GithubCountersService
impl Sync for GithubCountersService
impl Unpin for GithubCountersService
impl UnsafeUnpin for GithubCountersService
impl UnwindSafe for GithubCountersService
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