pub struct Cron<'a, D>{ /* private fields */ }
Expand description
The Cron
struct is the main entry point for the library, providing the ability to add and
remove jobs.
Implementations§
Source§impl<'a, D> Cron<'a, D>
impl<'a, D> Cron<'a, D>
Sourcepub async fn add_job<F>(
&self,
job_name: &str,
schedule: Schedule,
run: F,
) -> Result<(), Error<D>>
pub async fn add_job<F>( &self, job_name: &str, schedule: Schedule, run: F, ) -> Result<(), Error<D>>
Add a job to the cron
§Arguments
job_name
- The unique name of the jobschedule
- The schedule of the jobrun
- The function to run
Trait Implementations§
Auto Trait Implementations§
impl<'a, D> !Freeze for Cron<'a, D>
impl<'a, D> !RefUnwindSafe for Cron<'a, D>
impl<'a, D> Send for Cron<'a, D>
impl<'a, D> Sync for Cron<'a, D>
impl<'a, D> Unpin for Cron<'a, D>
impl<'a, D> !UnwindSafe for Cron<'a, D>
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
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>
Wrap the input message
T
in a tonic::Request