[][src]Struct hedwig::Message

pub struct Message<D, T> {
    pub id: Uuid,
    pub metadata: Metadata,
    pub schema: String,
    pub data: D,
    pub format_version: Version,
    pub data_type: T,
    pub data_schema_version: Version,
    // some fields omitted
}

Message represents an instance of a message on the message bus.

Fields

id: Uuid

Message identifier

metadata: Metadata

Metadata associated with the message

schema: String

Message schema, e.g. https://hedwig.standard.ai/schemas#/schemas/user.created/1.0

data: D

Associated message data

format_version: Version

Format version for the message container

data_type: T

Type of data represented by this message

data_schema_version: Version

Schema version of the data object. This should follow semver.

Methods

impl<D, T> Message<D, T>[src]

pub fn with_headers(&mut self, headers: Headers) -> &mut Self[src]

Add custom headers to the message. This may be used to track request_id, for example.

pub fn with_id(&mut self, id: Uuid) -> &mut Self[src]

Add custom id to the message. If not provided, a new uuid v4 is used.

Trait Implementations

impl<D: PartialEq, T: PartialEq> PartialEq<Message<D, T>> for Message<D, T>[src]

impl<D: Clone, T: Clone> Clone for Message<D, T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<D: Debug, T: Debug> Debug for Message<D, T>[src]

impl<D, T> Serialize for Message<D, T> where
    D: Serialize
[src]

Auto Trait Implementations

impl<D, T> Send for Message<D, T> where
    D: Send,
    T: Send

impl<D, T> Unpin for Message<D, T> where
    D: Unpin,
    T: Unpin

impl<D, T> Sync for Message<D, T> where
    D: Sync,
    T: Sync

impl<D, T> UnwindSafe for Message<D, T> where
    D: UnwindSafe,
    T: UnwindSafe

impl<D, T> RefUnwindSafe for Message<D, T> where
    D: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> GetTypeId for T where
    T: Any
[src]

fn typeid(&self) -> TypeId[src]