#[non_exhaustive]pub enum PubsubEvent {
Subscribe {
channel: Vec<u8>,
count: i64,
},
Psubscribe {
pattern: Vec<u8>,
count: i64,
},
Unsubscribe {
channel: Option<Vec<u8>>,
count: i64,
},
Punsubscribe {
pattern: Option<Vec<u8>>,
count: i64,
},
Message {
channel: Vec<u8>,
payload: Vec<u8>,
},
Pmessage {
pattern: Vec<u8>,
channel: Vec<u8>,
payload: Vec<u8>,
},
}Expand description
One pubsub frame received from the bus or the wire.
Unsubscribe / Punsubscribe’s channel / pattern is None when
the server is acknowledging “unsubscribed from everything” with a nil
bulk — matching the Redis wire shape.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Subscribe
SUBSCRIBE ack — one per channel the client subscribed to.
Fields
Psubscribe
PSUBSCRIBE ack — one per pattern.
Fields
Unsubscribe
UNSUBSCRIBE ack — channel: None when the server is reporting
“no channels were subscribed” (the spec’s nil bulk).
Fields
Punsubscribe
PUNSUBSCRIBE ack — pattern None when the server is reporting
“no patterns were subscribed”.
Fields
Message
Plain PUBLISH delivery on a subscribed channel.
Fields
Pmessage
Pattern-match delivery: a PUBLISH to a channel that matched one
of this connection’s patterns.
Trait Implementations§
Source§impl Clone for PubsubEvent
impl Clone for PubsubEvent
Source§fn clone(&self) -> PubsubEvent
fn clone(&self) -> PubsubEvent
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 PubsubEvent
impl Debug for PubsubEvent
impl Eq for PubsubEvent
Source§impl PartialEq for PubsubEvent
impl PartialEq for PubsubEvent
Source§fn eq(&self, other: &PubsubEvent) -> bool
fn eq(&self, other: &PubsubEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PubsubEvent
Auto Trait Implementations§
impl Freeze for PubsubEvent
impl RefUnwindSafe for PubsubEvent
impl Send for PubsubEvent
impl Sync for PubsubEvent
impl Unpin for PubsubEvent
impl UnsafeUnpin for PubsubEvent
impl UnwindSafe for PubsubEvent
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