pub struct PubSubContext { /* private fields */ }Expand description
Per-delivery context for a Redis Pub/Sub delivery (RedisPubSubMessage).
Implementations§
Source§impl PubSubContext
impl PubSubContext
Sourcepub fn new(channel: impl Into<String>, from_pattern: bool) -> Self
pub fn new(channel: impl Into<String>, from_pattern: bool) -> Self
Constructs a context directly from its native fields (mainly for tests).
Sourcepub fn channel(&self) -> &str
pub fn channel(&self) -> &str
The concrete channel this message arrived on (the matched channel, not the subscription glob, for a pattern subscription).
Sourcepub fn from_pattern(&self) -> bool
pub fn from_pattern(&self) -> bool
Whether the delivery matched through a PSUBSCRIBE pattern rather than an exact subscribe.
Trait Implementations§
Source§impl BuildContext<RedisPubSubMessage> for PubSubContext
impl BuildContext<RedisPubSubMessage> for PubSubContext
Source§fn build(msg: &RedisPubSubMessage) -> Self
fn build(msg: &RedisPubSubMessage) -> Self
Builds the context value by reading fields out of
msg.Source§impl Clone for PubSubContext
impl Clone for PubSubContext
Source§fn clone(&self) -> PubSubContext
fn clone(&self) -> PubSubContext
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 PubSubContext
impl Debug for PubSubContext
Source§impl Default for PubSubContext
impl Default for PubSubContext
Source§fn default() -> PubSubContext
fn default() -> PubSubContext
Returns the “default value” for a type. Read more
impl Eq for PubSubContext
Source§impl Field<PubSubContext> for Channel
impl Field<PubSubContext> for Channel
Source§impl Field<PubSubContext> for FromPattern
impl Field<PubSubContext> for FromPattern
Source§impl PartialEq for PubSubContext
impl PartialEq for PubSubContext
Source§fn eq(&self, other: &PubSubContext) -> bool
fn eq(&self, other: &PubSubContext) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PubSubContext
Auto Trait Implementations§
impl Freeze for PubSubContext
impl RefUnwindSafe for PubSubContext
impl Send for PubSubContext
impl Sync for PubSubContext
impl Unpin for PubSubContext
impl UnsafeUnpin for PubSubContext
impl UnwindSafe for PubSubContext
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