[−][src]Struct hedwig::Message
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]
H: Into<String>,
V: Into<String>,
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,
D: Unpin,
T: Unpin,
impl<D, T> Sync for Message<D, T> where
D: Sync,
T: Sync,
D: Sync,
T: Sync,
impl<D, T> Send for Message<D, T> where
D: Send,
T: Send,
D: Send,
T: Send,
impl<D, T> UnwindSafe for Message<D, T> where
D: UnwindSafe,
T: UnwindSafe,
D: UnwindSafe,
T: UnwindSafe,
impl<D, T> RefUnwindSafe for Message<D, T> where
D: RefUnwindSafe,
T: RefUnwindSafe,
D: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> GetTypeId for T where
T: Any,
[src]
T: Any,