pub struct JobRequest<T> { /* private fields */ }
Expand description

Represents a job which can be serialized and executed

Implementations

Creates a new JobRequest

Creates a Job request with context provided

Get the underlying reference of the [Job]

Gets a mutable reference to the job context.

Gets a reference to the job context.

Records a job attempt

Methods from Deref<Target = JobContext>

Get a reference to a type previously inserted on this JobContext.

Example
let mut ctx = JobContext::new(1.to_string());
assert!(ctx.data_opt::<i32>().is_none());
ctx.insert(5i32);

assert_eq!(ctx.data_opt::<i32>(), Some(&5i32));

Insert a type into this JobContext.

Important for embedding data for a job. If a extension of this type already existed, it will be returned.

Example
let mut ctx = JobContext::new(1.to_string());
assert!(ctx.insert(5i32).is_none());
assert!(ctx.insert(4u8).is_none());
assert_eq!(ctx.insert(9i32), Some(5i32));

Set the number of attempts

Gets the maximum attempts for a job. Default 25

Get the id for a job

Gets the current attempts for a job. Default 0

Set the number of attempts

Get the time a job was done

Set the time a job was done

Get the time a job is supposed to start

Set the time a job should run

Get the time a job was locked

Set the lock_at value

Get the job status

Set the job status

Get the time a job was locked

Set lock_by

Get the time a job was locked

Set the last error

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Deserialize this value from the given Serde deserializer. Read more

The Future type returned by Policy::retry.

Check the policy if a certain request should be retried. Read more

Tries to clone a request before being passed to the inner service. Read more

Serialize this value into the given Serde serializer. Read more

Responses given by the service.

Errors produced by the service.

The future response value.

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more

Process the request and return the response asynchronously. Read more

Responses given by the service.

Errors produced by the service.

The future response value.

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more

Process the request and return the response asynchronously. Read more

Responses given by the service.

Errors produced by the service.

The future response value.

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more

Process the request and return the response asynchronously. Read more

Responses given by the service.

Errors produced by the service.

The future response value.

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more

Process the request and return the response asynchronously. Read more

Responses given by the service.

Errors produced by the service.

The future response value.

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more

Process the request and return the response asynchronously. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more