pub struct ScheduleHandle<CT> { /* private fields */ }Expand description
Handle to an existing schedule. Obtained from
Client::create_schedule or
Client::get_schedule_handle.
Implementations§
Source§impl<CT> ScheduleHandle<CT>
impl<CT> ScheduleHandle<CT>
Sourcepub fn schedule_id(&self) -> &str
pub fn schedule_id(&self) -> &str
The schedule ID.
Sourcepub async fn describe(&self) -> Result<ScheduleDescription, ScheduleError>
pub async fn describe(&self) -> Result<ScheduleDescription, ScheduleError>
Describe this schedule, returning its full definition, info, and conflict token.
Sourcepub async fn update(
&self,
updater: impl FnOnce(&mut ScheduleUpdate),
) -> Result<(), ScheduleError>
pub async fn update( &self, updater: impl FnOnce(&mut ScheduleUpdate), ) -> Result<(), ScheduleError>
Update the schedule definition.
Describes the current schedule, applies the closure to modify it, and sends the update. The conflict token is managed automatically.
handle.update(|u| {
u.set_note("updated").set_paused(true);
}).await?;Sourcepub async fn send_update(
&self,
update: ScheduleUpdate,
) -> Result<(), ScheduleError>
pub async fn send_update( &self, update: ScheduleUpdate, ) -> Result<(), ScheduleError>
Send a pre-built ScheduleUpdate to the server.
Prefer update() for most use cases. Use this when you
need to inspect the ScheduleDescription before deciding what to
change.
Sourcepub async fn delete(&self) -> Result<(), ScheduleError>
pub async fn delete(&self) -> Result<(), ScheduleError>
Delete this schedule.
Sourcepub async fn pause(
&self,
note: Option<impl Into<String>>,
) -> Result<(), ScheduleError>
pub async fn pause( &self, note: Option<impl Into<String>>, ) -> Result<(), ScheduleError>
Pause the schedule with an optional note.
If note is None, a default note is used.
Sourcepub async fn unpause(
&self,
note: Option<impl Into<String>>,
) -> Result<(), ScheduleError>
pub async fn unpause( &self, note: Option<impl Into<String>>, ) -> Result<(), ScheduleError>
Unpause the schedule with an optional note.
If note is None, a default note is used.
Sourcepub async fn trigger(
&self,
overlap_policy: ScheduleOverlapPolicy,
) -> Result<(), ScheduleError>
pub async fn trigger( &self, overlap_policy: ScheduleOverlapPolicy, ) -> Result<(), ScheduleError>
Trigger the schedule to run immediately with the given overlap policy.
Sourcepub async fn backfill(
&self,
backfills: impl IntoIterator<Item = ScheduleBackfill>,
) -> Result<(), ScheduleError>
pub async fn backfill( &self, backfills: impl IntoIterator<Item = ScheduleBackfill>, ) -> Result<(), ScheduleError>
Request backfill of missed runs.
Trait Implementations§
Source§impl<CT: Clone> Clone for ScheduleHandle<CT>
impl<CT: Clone> Clone for ScheduleHandle<CT>
Source§fn clone(&self) -> ScheduleHandle<CT>
fn clone(&self) -> ScheduleHandle<CT>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<CT> Freeze for ScheduleHandle<CT>where
CT: Freeze,
impl<CT> RefUnwindSafe for ScheduleHandle<CT>where
CT: RefUnwindSafe,
impl<CT> Send for ScheduleHandle<CT>where
CT: Send,
impl<CT> Sync for ScheduleHandle<CT>where
CT: Sync,
impl<CT> Unpin for ScheduleHandle<CT>where
CT: Unpin,
impl<CT> UnsafeUnpin for ScheduleHandle<CT>where
CT: UnsafeUnpin,
impl<CT> UnwindSafe for ScheduleHandle<CT>where
CT: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request