pub trait Object: Sized {
// Required methods
fn create(
&self,
context: ObjectContext<'_>,
job: Json<JobSpec>,
) -> impl Future<Output = Result<(), HandlerError>> + Send;
fn replace(
&self,
context: ObjectContext<'_>,
job: Json<JobSpec>,
) -> impl Future<Output = Result<(), HandlerError>> + Send;
fn cancel(
&self,
context: ObjectContext<'_>,
) -> impl Future<Output = Result<(), HandlerError>> + Send;
fn run(
&self,
context: ObjectContext<'_>,
) -> impl Future<Output = Result<(), HandlerError>> + Send;
fn get(
&self,
context: SharedObjectContext<'_>,
) -> impl Future<Output = Result<Json<JobSpec>, HandlerError>> + Send;
fn get_next_run(
&self,
context: SharedObjectContext<'_>,
) -> impl Future<Output = Result<Json<NextRun>, HandlerError>> + Send;
// Provided method
fn serve(self) -> ServeObject<Self> { ... }
}Required Methods§
Sourcefn create(
&self,
context: ObjectContext<'_>,
job: Json<JobSpec>,
) -> impl Future<Output = Result<(), HandlerError>> + Send
fn create( &self, context: ObjectContext<'_>, job: Json<JobSpec>, ) -> impl Future<Output = Result<(), HandlerError>> + Send
Create a new cron job.
Sourcefn replace(
&self,
context: ObjectContext<'_>,
job: Json<JobSpec>,
) -> impl Future<Output = Result<(), HandlerError>> + Send
fn replace( &self, context: ObjectContext<'_>, job: Json<JobSpec>, ) -> impl Future<Output = Result<(), HandlerError>> + Send
Create a new or replace an existing cron job.
Sourcefn cancel(
&self,
context: ObjectContext<'_>,
) -> impl Future<Output = Result<(), HandlerError>> + Send
fn cancel( &self, context: ObjectContext<'_>, ) -> impl Future<Output = Result<(), HandlerError>> + Send
Cancel an existing cron job.
Sourcefn run(
&self,
context: ObjectContext<'_>,
) -> impl Future<Output = Result<(), HandlerError>> + Send
fn run( &self, context: ObjectContext<'_>, ) -> impl Future<Output = Result<(), HandlerError>> + Send
Internal handler for running the cron job.
Sourcefn get(
&self,
context: SharedObjectContext<'_>,
) -> impl Future<Output = Result<Json<JobSpec>, HandlerError>> + Send
fn get( &self, context: SharedObjectContext<'_>, ) -> impl Future<Output = Result<Json<JobSpec>, HandlerError>> + Send
Get the details of an existing cron job.
Sourcefn get_next_run(
&self,
context: SharedObjectContext<'_>,
) -> impl Future<Output = Result<Json<NextRun>, HandlerError>> + Send
fn get_next_run( &self, context: SharedObjectContext<'_>, ) -> impl Future<Output = Result<Json<NextRun>, HandlerError>> + Send
Get the next run time of an existing cron job.
Provided Methods§
Sourcefn serve(self) -> ServeObject<Self>
fn serve(self) -> ServeObject<Self>
Returns a serving function to use with [::restate_sdk::endpoint::Builder::with_service].
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.