pub struct StreamContext { /* private fields */ }Expand description
Per-delivery context for a Redis Streams delivery (RedisMessage).
Built once per delivery from the message. Read its fields by keys key off a
Context.
Implementations§
Source§impl StreamContext
impl StreamContext
Sourcepub fn new(entry_id: Option<String>, consumer_group: Option<String>) -> Self
pub fn new(entry_id: Option<String>, consumer_group: Option<String>) -> Self
Constructs a context directly from its native fields (mainly for tests).
Sourcepub fn entry_id(&self) -> Option<&str>
pub fn entry_id(&self) -> Option<&str>
The stream entry id (for example 1700000000000-0) this delivery was read at.
Sourcepub fn consumer_group(&self) -> Option<&str>
pub fn consumer_group(&self) -> Option<&str>
The consumer group this delivery was read through.
Trait Implementations§
Source§impl BuildContext<RedisMessage> for StreamContext
impl BuildContext<RedisMessage> for StreamContext
Source§fn build(msg: &RedisMessage) -> Self
fn build(msg: &RedisMessage) -> Self
Builds the context value by reading fields out of
msg.Source§impl Clone for StreamContext
impl Clone for StreamContext
Source§fn clone(&self) -> StreamContext
fn clone(&self) -> StreamContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamContext
impl Debug for StreamContext
Source§impl Default for StreamContext
impl Default for StreamContext
Source§fn default() -> StreamContext
fn default() -> StreamContext
Returns the “default value” for a type. Read more
impl Eq for StreamContext
Source§impl Field<StreamContext> for EntryId
impl Field<StreamContext> for EntryId
Source§impl Field<StreamContext> for ConsumerGroup
impl Field<StreamContext> for ConsumerGroup
Source§impl PartialEq for StreamContext
impl PartialEq for StreamContext
Source§fn eq(&self, other: &StreamContext) -> bool
fn eq(&self, other: &StreamContext) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StreamContext
Auto Trait Implementations§
impl Freeze for StreamContext
impl RefUnwindSafe for StreamContext
impl Send for StreamContext
impl Sync for StreamContext
impl Unpin for StreamContext
impl UnsafeUnpin for StreamContext
impl UnwindSafe for StreamContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more