pub struct JobHandle<J = ()> { /* private fields */ }Expand description
A handle to a single job.
The handle also caches the details of the job, so that they can be accessed without making a network request.
Implementations§
Source§impl<J> JobHandle<J>
impl<J> JobHandle<J>
Sourcepub async fn details(&self) -> Result<Arc<JobDetails>>
pub async fn details(&self) -> Result<Arc<JobDetails>>
Get the details of the job.
Sourcepub fn details_cached(&self) -> Option<Arc<JobDetails>>
pub fn details_cached(&self) -> Option<Arc<JobDetails>>
Get the cached details of the job, if available.
This is useful for getting the details of a job without making a network request.
Sourcepub fn cast_type<T: JobType>(&self) -> JobHandle<T>
pub fn cast_type<T: JobType>(&self) -> JobHandle<T>
Cast the job handle to a specific job type.
This does not perform any runtime checks, so it is up to the caller to ensure that the job type is correct.
Sourcepub fn cast_unknown(&self) -> JobHandle
pub fn cast_unknown(&self) -> JobHandle
Cast the job handle to an unknown job type.
Trait Implementations§
Source§impl<J> IntoFuture for JobHandle<J>where
J: JobType,
impl<J> IntoFuture for JobHandle<J>where
J: JobType,
Source§type Output = Result<<J as JobType>::Output, Report>
type Output = Result<<J as JobType>::Output, Report>
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = <JobHandle<J> as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <JobHandle<J> as IntoFuture>::Output> + Send>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<J = ()> !Freeze for JobHandle<J>
impl<J = ()> !RefUnwindSafe for JobHandle<J>
impl<J> Send for JobHandle<J>where
J: Send,
impl<J> Sync for JobHandle<J>where
J: Sync,
impl<J> Unpin for JobHandle<J>where
J: Unpin,
impl<J = ()> !UnwindSafe for JobHandle<J>
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> 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<W> IntoExecutionHandler for W
impl<W> IntoExecutionHandler for W
Source§fn handler<J>(self) -> Arc<dyn ExecutionHandlerRaw + Send + Sync>where
Self: ExecutionHandler<J>,
J: JobType,
fn handler<J>(self) -> Arc<dyn ExecutionHandlerRaw + Send + Sync>where
Self: ExecutionHandler<J>,
J: JobType,
Convert
self into a [RawHandler] that can be registered
in workers.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