pub struct MemorySubscriber<Log = Discarding> { /* private fields */ }Expand description
Subscriber returned by MemoryBroker::subscribe. Yields one MemoryMessage per
delivery; consumers must call ack or nack on each.
Also consumable in batches through the BatchSubscriber capability,
which caps each batch at the size it is asked for and allocates it at that size up front. A
subscription of a Retaining broker is
repositionable over its publish log through the Seekable capability: mint
a MemorySeeker with seeker before opening the stream.
Trait Implementations§
Source§impl<Log: LogMode> BatchSubscriber for MemorySubscriber<Log>
Greedy batching: a batch is the first awaited delivery plus everything already buffered, up to
the size the registration asked for. Partial batches ship immediately, so no deadline timer is
needed - the in-memory transport has nothing to wait for. Each batch is allocated at the
requested size up front, so a partial batch holds the room of a full one.
impl<Log: LogMode> BatchSubscriber for MemorySubscriber<Log>
Greedy batching: a batch is the first awaited delivery plus everything already buffered, up to the size the registration asked for. Partial batches ship immediately, so no deadline timer is needed - the in-memory transport has nothing to wait for. Each batch is allocated at the requested size up front, so a partial batch holds the room of a full one.
Source§type Batch = Vec<MemoryMessage<Log>>
type Batch = Vec<MemoryMessage<Log>>
batches. Implementations choose between Vec, custom
iterators, or anything else that yields the underlying Subscriber::Message.Source§impl<Log> Debug for MemorySubscriber<Log>
impl<Log> Debug for MemorySubscriber<Log>
Source§impl<Log> Drop for MemorySubscriber<Log>
Available on crate feature testing only.
impl<Log> Drop for MemorySubscriber<Log>
testing only.Source§impl Seekable for MemorySubscriber<Retaining>
Seeking is native on a retaining broker: it keeps a bounded publish log per name, so a
subscription can re-enqueue any retained suffix of it. A discarding broker keeps no log, and
its subscriptions carry no seek surface at all.
impl Seekable for MemorySubscriber<Retaining>
Seeking is native on a retaining broker: it keeps a bounded publish log per name, so a subscription can re-enqueue any retained suffix of it. A discarding broker keeps no log, and its subscriptions carry no seek surface at all.
Source§type Seeker = MemorySeeker
type Seeker = MemorySeeker
Source§fn seeker(&self) -> MemorySeeker
fn seeker(&self) -> MemorySeeker
Source§impl<Log: LogMode> Subscriber for MemorySubscriber<Log>
impl<Log: LogMode> Subscriber for MemorySubscriber<Log>
Source§type Message = MemoryMessage<Log>
type Message = MemoryMessage<Log>
Auto Trait Implementations§
impl<Log = Discarding> !RefUnwindSafe for MemorySubscriber<Log>
impl<Log = Discarding> !UnwindSafe for MemorySubscriber<Log>
impl<Log> Freeze for MemorySubscriber<Log>where
PhantomData<Log>: Freeze,
impl<Log> Send for MemorySubscriber<Log>where
PhantomData<Log>: Send,
impl<Log> Sync for MemorySubscriber<Log>where
PhantomData<Log>: Sync,
impl<Log> Unpin for MemorySubscriber<Log>where
PhantomData<Log>: Unpin,
impl<Log> UnsafeUnpin for MemorySubscriber<Log>where
PhantomData<Log>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request