pub struct DefaultSlot;Expand description
The implicit marker of a single unnamed Out<impl Publisher> parameter.
A handler with one Out parameter needs no marker: the parameter binds to this slot, and the
include site attaches its policy by naming the marker like any other, .out(DefaultSlot, policy).
§Examples
use ruststream::memory::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Deserialize)]
struct Order {
id: u64,
}
#[derive(Serialize, Outgoing)]
#[outgoing(name = "orders.accepted")]
struct Accepted {
id: u64,
}
/// One `Out` parameter and no marker: it binds to `DefaultSlot`.
#[subscriber("orders")]
async fn accept(order: &Order, Out(out): Out<impl Publisher>) -> HandlerOutcome {
match out.message(&Accepted { id: order.id }).publish().await {
Ok(()) => HandlerOutcome::ack(),
Err(_) => HandlerOutcome::retry(),
}
}
fn app() -> RustStream {
RustStream::new(AppInfo::new("orders", "0.1.0")).with_broker(MemoryBroker::new(), |b| {
b.include(accept).out(DefaultSlot, Publish).build();
})
}Trait Implementations§
Source§impl Clone for DefaultSlot
impl Clone for DefaultSlot
Source§fn clone(&self) -> DefaultSlot
fn clone(&self) -> DefaultSlot
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 moreimpl Copy for DefaultSlot
Source§impl Debug for DefaultSlot
impl Debug for DefaultSlot
Source§impl Default for DefaultSlot
impl Default for DefaultSlot
Source§fn default() -> DefaultSlot
fn default() -> DefaultSlot
Returns the “default value” for a type. Read more
impl Eq for DefaultSlot
Source§impl Hash for DefaultSlot
impl Hash for DefaultSlot
Source§impl OutSlot for DefaultSlot
impl OutSlot for DefaultSlot
Source§const NAME: &'static str = "default"
const NAME: &'static str = "default"
The human-readable slot name, used by diagnostics and test assertions.
Source§type Destination = Reads
type Destination = Reads
The most a transform on this slot may do to a message’s destination. Read more
Source§fn outgoing() -> Vec<OutgoingMessageMetadata>
fn outgoing() -> Vec<OutgoingMessageMetadata>
The slot’s publish dictionary as
AsyncAPI metadata, one entry per
#[publishes(..)] type. The derive fills this in; the default (a marker without a
dictionary) publishes nothing declared. Called once at registration; never on the
publish path.Source§impl PartialEq for DefaultSlot
impl PartialEq for DefaultSlot
impl StructuralPartialEq for DefaultSlot
Auto Trait Implementations§
impl Freeze for DefaultSlot
impl RefUnwindSafe for DefaultSlot
impl Send for DefaultSlot
impl Sync for DefaultSlot
impl Unpin for DefaultSlot
impl UnsafeUnpin for DefaultSlot
impl UnwindSafe for DefaultSlot
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