pub trait SessionScheduleStore: Send + Sync {
// Required methods
fn create_schedule<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
description: String,
cron_expression: Option<String>,
scheduled_at: Option<DateTime<Utc>>,
timezone: String,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn cancel_schedule<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
schedule_id: ScheduleId,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_schedules<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionSchedule>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count_active_schedules<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count_active_org_schedules<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn create_schedule_enforcing_limits<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
description: String,
cron_expression: Option<String>,
scheduled_at: Option<DateTime<Utc>>,
timezone: String,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule, ScheduleLimitError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Trait for session schedule CRUD operations.
Used by scheduling tools to create, cancel, and list schedules.
Required Methods§
Sourcefn create_schedule<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
description: String,
cron_expression: Option<String>,
scheduled_at: Option<DateTime<Utc>>,
timezone: String,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_schedule<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
description: String,
cron_expression: Option<String>,
scheduled_at: Option<DateTime<Utc>>,
timezone: String,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new schedule for a session.
Sourcefn cancel_schedule<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
schedule_id: ScheduleId,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancel_schedule<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
schedule_id: ScheduleId,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cancel (disable) a schedule.
Sourcefn list_schedules<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionSchedule>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_schedules<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionSchedule>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List schedules for a session.
Sourcefn count_active_schedules<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_active_schedules<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Count active (enabled) schedules for a session.
Sourcefn count_active_org_schedules<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_active_org_schedules<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Count active (enabled) schedules across the whole org this store is
scoped to. Used to enforce a per-org cap independent of session count:
count_active_schedules only bounds one session, so unlimited sessions
would otherwise imply unlimited active schedules per org.
Provided Methods§
Sourcefn create_schedule_enforcing_limits<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
description: String,
cron_expression: Option<String>,
scheduled_at: Option<DateTime<Utc>>,
timezone: String,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule, ScheduleLimitError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_schedule_enforcing_limits<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
description: String,
cron_expression: Option<String>,
scheduled_at: Option<DateTime<Utc>>,
timezone: String,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule, ScheduleLimitError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new schedule after enforcing create-time limits in the same store operation. Backends with shared mutable state must override this to make the check-and-create sequence atomic.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".