[−][src]Struct hedwig::Message
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(&self) -> 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]
D: Serialize,
Auto Trait Implementations
impl<D, T> Send for Message<D, T> where
D: Send,
T: Send,
D: Send,
T: Send,
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> 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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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,