pub(crate) trait CronFacade: Send + Sync {
// Required methods
fn create_cron(
&self,
caller: &SessionSlot,
kind: CronKind,
prompt: String,
description: Option<String>,
wake: bool,
) -> Result<CronEntry, CronCreateError>;
fn list_crons(
&self,
caller: &SessionSlot,
) -> Result<Vec<CronEntry>, CronListError>;
fn delete_cron(
&self,
caller: &SessionSlot,
id: &CronId,
) -> Result<CronEntry, CronDeleteError>;
}Expand description
The cron tools’ view of the workspace. Sync - cron-list mutations are direct state writes with no async handler to await.
Required Methods§
Sourcefn create_cron(
&self,
caller: &SessionSlot,
kind: CronKind,
prompt: String,
description: Option<String>,
wake: bool,
) -> Result<CronEntry, CronCreateError>
fn create_cron( &self, caller: &SessionSlot, kind: CronKind, prompt: String, description: Option<String>, wake: bool, ) -> Result<CronEntry, CronCreateError>
Validate + register a cron owned by the caller: compute
next_fire, persist, and return the new entry. description is
the caller-supplied human summary (already trimmed to None when
blank).
Sourcefn list_crons(
&self,
caller: &SessionSlot,
) -> Result<Vec<CronEntry>, CronListError>
fn list_crons( &self, caller: &SessionSlot, ) -> Result<Vec<CronEntry>, CronListError>
The crons the caller registered, within its project. An empty answer means the caller has none.
Sourcefn delete_cron(
&self,
caller: &SessionSlot,
id: &CronId,
) -> Result<CronEntry, CronDeleteError>
fn delete_cron( &self, caller: &SessionSlot, id: &CronId, ) -> Result<CronEntry, CronDeleteError>
Delete the caller’s own cron by id, within its project, and return
the entry as it stood. A refusal says which case it is:
CronDeleteError::NoSuchCron when the project has no such id,
CronDeleteError::NotOwnedByCaller when it has one under
another session.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".