pub struct InRound;Expand description
The reply transform that puts a reply in the round of the delivery it answers.
A reply is published after the handler returns and before the delivery settles. Mounted on
the reply position of a .pipeline() subscription, this transform queues it into the
delivery’s segment instead: it leaves with the window, after what the handler queued, and
under .atomic() inside the delivery’s MULTI / EXEC. On a subscription without a window
the reply leaves at once, as it does without the transform.
§Examples
use ruststream_fred::stream::prelude::*;
use serde::Serialize;
#[derive(Serialize, Outgoing)]
#[outgoing(name = "receipts")]
struct Receipt {
id: u64,
}
#[subscriber(RedisStream::new("orders").group("workers"), reply)]
async fn issue(order: &Order) -> Receipt {
Receipt { id: order.id }
}
fn app() -> RustStream {
RustStream::new(AppInfo::new("receipts", "0.1.0")).with_broker(
RedisBroker::standalone("redis://localhost:6379"),
|b| {
b.include(issue.pipeline()).out_reply(Publish).transform(InRound);
},
)
}Trait Implementations§
impl Copy for InRound
impl Eq for InRound
Source§impl<C> PublishTransform<ForReply<C>, RedisPublishOptions> for InRound
impl<C> PublishTransform<ForReply<C>, RedisPublishOptions> for InRound
Source§fn apply(
&self,
_out: &mut Outgoing<'_>,
options: &mut Option<RedisPublishOptions>,
_cx: &PublishContext<'_, C>,
)
fn apply( &self, _out: &mut Outgoing<'_>, options: &mut Option<RedisPublishOptions>, _cx: &PublishContext<'_, C>, )
Transforms
out in place before it is sent, reading the position’s view through cx and
resolving the broker’s per-message settings through options. Read moreimpl StructuralPartialEq for InRound
Auto Trait Implementations§
impl Freeze for InRound
impl RefUnwindSafe for InRound
impl Send for InRound
impl Sync for InRound
impl Unpin for InRound
impl UnsafeUnpin for InRound
impl UnwindSafe for InRound
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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