pub struct RoutingContext<'a> { /* private fields */ }Expand description
Routing metadata shared by source and sink records.
Implementations§
Source§impl<'a> RoutingContext<'a>
impl<'a> RoutingContext<'a>
Sourcepub fn new(
topic: &'a str,
key: Option<&'a str>,
partition: Option<&'a str>,
attributes: &'a HashMap<String, String>,
) -> Self
pub fn new( topic: &'a str, key: Option<&'a str>, partition: Option<&'a str>, attributes: &'a HashMap<String, String>, ) -> Self
Create a routing context from its raw topic, key, partition, and attributes.
Sourcepub fn key(&self) -> Option<&'a str>
pub fn key(&self) -> Option<&'a str>
Return the routing key used for partitioned publishing, if present.
Sourcepub fn partition(&self) -> Option<&'a str>
pub fn partition(&self) -> Option<&'a str>
Return the partition identifier for consumed records, if known.
Sourcepub fn attributes(&self) -> &'a HashMap<String, String>
pub fn attributes(&self) -> &'a HashMap<String, String>
Return the user-defined record attributes.
Trait Implementations§
Source§impl<'a> Clone for RoutingContext<'a>
impl<'a> Clone for RoutingContext<'a>
Source§fn clone(&self) -> RoutingContext<'a>
fn clone(&self) -> RoutingContext<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for RoutingContext<'a>
impl<'a> Debug for RoutingContext<'a>
impl<'a> Copy for RoutingContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for RoutingContext<'a>
impl<'a> RefUnwindSafe for RoutingContext<'a>
impl<'a> Send for RoutingContext<'a>
impl<'a> Sync for RoutingContext<'a>
impl<'a> Unpin for RoutingContext<'a>
impl<'a> UnsafeUnpin for RoutingContext<'a>
impl<'a> UnwindSafe for RoutingContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request