Skip to main content

EventEnvelopeMetadata

Struct EventEnvelopeMetadata 

Source
pub struct EventEnvelopeMetadata { /* private fields */ }
Expand description

Type-erased event metadata exposed to global interceptors.

Implementations§

Source§

impl EventEnvelopeMetadata

Source

pub fn id(&self) -> &str

Returns the event ID.

§Returns

Stable event identifier.

Source

pub fn topic_name(&self) -> &str

Returns the topic name.

§Returns

Topic name without payload type information.

Source

pub fn payload_type_name(&self) -> &'static str

Returns the Rust payload type name.

§Returns

Fully qualified payload type name.

Source

pub fn headers(&self) -> &HashMap<String, String>

Returns event headers.

§Returns

Immutable header map.

Source

pub fn ordering_key(&self) -> Option<&str>

Returns the optional ordering key.

§Returns

Some when an ordering key was configured.

Source

pub fn timestamp(&self) -> SystemTime

Returns event creation timestamp.

§Returns

Timestamp assigned when the envelope was built.

Source

pub fn delay(&self) -> Option<Duration>

Returns optional delivery delay.

§Returns

Some when delayed delivery metadata was configured.

Source

pub fn is_dead_letter(&self) -> bool

Returns whether this metadata represents a dead letter.

§Returns

true if the source envelope is already a dead letter.

Source

pub fn with_header(self, key: &str, value: impl ToString) -> Self

Adds or replaces one header.

§Parameters
  • key: Header key.
  • value: Header value converted to string.
§Returns

Updated metadata.

Source

pub fn without_header(self, key: &str) -> Self

Removes one header.

§Parameters
  • key: Header key to remove.
§Returns

Updated metadata.

Source

pub fn with_ordering_key(self, ordering_key: &str) -> Self

Sets the ordering key.

§Parameters
  • ordering_key: Ordering key used by supporting backends.
§Returns

Updated metadata.

Source

pub fn without_ordering_key(self) -> Self

Clears the ordering key.

§Returns

Updated metadata without an ordering key.

Source

pub fn with_delay(self, delay: Duration) -> Self

Sets delayed delivery metadata.

§Parameters
  • delay: Requested delivery delay.
§Returns

Updated metadata.

Source

pub fn without_delay(self) -> Self

Clears delayed delivery metadata.

§Returns

Updated metadata without a delay.

Trait Implementations§

Source§

impl Clone for EventEnvelopeMetadata

Source§

fn clone(&self) -> EventEnvelopeMetadata

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EventEnvelopeMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl IntoPublisherInterceptorAnyResult for EventEnvelopeMetadata

Source§

fn into_publisher_interceptor_any_result( self, ) -> EventBusResult<Option<EventEnvelopeMetadata>>

Converts the value into a global publisher interceptor result. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoResult<T> for T

Source§

impl<T> IntoValueDefault<T> for T

Source§

fn into_value_default(self) -> T

Converts this argument into the default value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.