pub struct RedisPubSubPublish { /* private fields */ }Expand description
The declaration half of the Pub/Sub publisher: delivery mode and envelope codec, no connection.
Constructible anywhere (in a router definition, in configuration), it pairs into a
RedisPubSubPublisher against a ConnectedRedisBroker. The publish mode must match how
subscribers subscribed: a sharded publish only reaches sharded subscribers.
§Examples
use ruststream_fred::{PubSubMode, RedisPubSubPublish};
let classic = RedisPubSubPublish::default();
let sharded = RedisPubSubPublish::new().mode(PubSubMode::Sharded);Implementations§
Source§impl RedisPubSubPublish
impl RedisPubSubPublish
Sourcepub fn new() -> Self
pub fn new() -> Self
A classic-mode policy with the default binary framing. Equivalent to Self::default.
Sourcepub const fn mode(self, mode: PubSubMode) -> Self
pub const fn mode(self, mode: PubSubMode) -> Self
Sets the publish mode. Defaults to PubSubMode::Classic.
Trait Implementations§
Source§impl Clone for RedisPubSubPublish
impl Clone for RedisPubSubPublish
Source§fn clone(&self) -> RedisPubSubPublish
fn clone(&self) -> RedisPubSubPublish
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 RedisPubSubPublish
impl Debug for RedisPubSubPublish
Source§impl Default for RedisPubSubPublish
impl Default for RedisPubSubPublish
Source§fn default() -> RedisPubSubPublish
fn default() -> RedisPubSubPublish
Returns the “default value” for a type. Read more
Source§impl PublishPolicy<ConnectedRedisBroker> for RedisPubSubPublish
impl PublishPolicy<ConnectedRedisBroker> for RedisPubSubPublish
Source§type Live = RedisPubSubPublisher
type Live = RedisPubSubPublisher
The live form this policy pairs into: a
Publisher for a leaf policy, or the live
wiring form for a combinator stack (a typed publisher over a policy pairs into the same
typed publisher over the live leaf).Auto Trait Implementations§
impl !RefUnwindSafe for RedisPubSubPublish
impl !UnwindSafe for RedisPubSubPublish
impl Freeze for RedisPubSubPublish
impl Send for RedisPubSubPublish
impl Sync for RedisPubSubPublish
impl Unpin for RedisPubSubPublish
impl UnsafeUnpin for RedisPubSubPublish
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