pub struct Task<'a, Op: Operation, Metadata: Serializable> {
pub routing_key: String,
pub metadata: Metadata,
pub op: &'a Op,
pub input: Op::Input,
}
Expand description
A Task
encodes an Operation
paired with arguments.
In addition to the Operation
and its arguments, a Task
also contains
metadata and routing information. The routing information is used to
identify the Channel
to which execution results
should be sent.
Metadata can be any arbitrary Serializable
type.
It’s typically used by Directive
s to encode
additional information about the computation.
Fields§
§routing_key: String
The routing key used to identify the
Channel
to which execution results should
be sent.
metadata: Metadata
Metadata associated with the Task
.
op: &'a Op
The Operation
to be executed.
input: Op::Input
The arguments to the Operation
.
Implementations§
Source§impl<'a, Op: Operation, Metadata: Serializable> Task<'a, Op, Metadata>
impl<'a, Op: Operation, Metadata: Serializable> Task<'a, Op, Metadata>
Sourcepub fn as_any_task(&self, serializer: Serializer) -> Result<AnyTask>
pub fn as_any_task(&self, serializer: Serializer) -> Result<AnyTask>
Trait Implementations§
Auto Trait Implementations§
impl<'a, Op, Metadata> Freeze for Task<'a, Op, Metadata>
impl<'a, Op, Metadata> RefUnwindSafe for Task<'a, Op, Metadata>
impl<'a, Op, Metadata> Send for Task<'a, Op, Metadata>
impl<'a, Op, Metadata> Sync for Task<'a, Op, Metadata>
impl<'a, Op, Metadata> Unpin for Task<'a, Op, Metadata>
impl<'a, Op, Metadata> UnwindSafe for Task<'a, Op, Metadata>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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