[][src]Struct hedwig::Message

pub struct Message<D, T> { /* fields omitted */ }

A message builder.

Methods

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

pub fn new(data_type: T, data_schema_version: Version, data: D) -> Self[src]

Construct a new message.

pub fn headers(self, headers: HashMap<String, String>) -> Self[src]

Overwrite the header map associated with the message.

This may be used to track the request_id, for example.

pub fn header<H, V>(self, header: H, value: V) -> Self where
    H: Into<String>,
    V: Into<String>, 
[src]

Add a custom header to the message.

This may be used to track the request_id, for example.

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

Add custom id to the message. If not provided, a random UUID is generated.

Trait Implementations

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

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

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

Auto Trait Implementations

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> Send for Message<D, T> where
    D: Send,
    T: Send

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for 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

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