pub struct Message {
pub properties: MessageProperties,
pub headers: MessageHeaders,
pub raw_body: Vec<u8>,
}
Expand description
A Message
is the core of the Celery protocol and is built on top of a Broker
’s protocol.
Every message corresponds to a task.
Note that the raw_body
field is the serialized form of a MessageBody
so that a worker can read the meta data of a message without having to deserialize the body
first.
Fields§
§properties: MessageProperties
Message properties correspond to the equivalent AMQP delivery properties.
headers: MessageHeaders
Message headers contain additional meta data pertaining to the Celery protocol.
raw_body: Vec<u8>
A serialized MessageBody
.
Implementations§
Source§impl Message
impl Message
Sourcepub fn body<T: Task>(&self) -> Result<MessageBody<T>, ProtocolError>
pub fn body<T: Task>(&self) -> Result<MessageBody<T>, ProtocolError>
Try deserializing the body.
pub fn json_serialized( &self, delivery_info: Option<DeliveryInfo>, ) -> Result<Vec<u8>, ProtocolError>
Trait Implementations§
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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