pub struct BufferedHandler { /* private fields */ }Expand description
A handler that buffers messages in memory.
Implementations§
Source§impl BufferedHandler
impl BufferedHandler
Sourcepub fn with_max_size(max_size: usize) -> Self
pub fn with_max_size(max_size: usize) -> Self
Create a handler with a maximum buffer size.
Sourcepub fn messages(&self) -> Vec<StreamMessage>
pub fn messages(&self) -> Vec<StreamMessage>
Get all buffered messages.
Trait Implementations§
Source§impl Default for BufferedHandler
impl Default for BufferedHandler
Source§impl StreamHandler for BufferedHandler
impl StreamHandler for BufferedHandler
Source§fn handle(&self, message: &StreamMessage)
fn handle(&self, message: &StreamMessage)
Process a stream message.
Source§fn should_handle(&self, _message: &StreamMessage) -> bool
fn should_handle(&self, _message: &StreamMessage) -> bool
Filter predicate - return false to skip handling this message.
Auto Trait Implementations§
impl !Freeze for BufferedHandler
impl RefUnwindSafe for BufferedHandler
impl Send for BufferedHandler
impl Sync for BufferedHandler
impl Unpin for BufferedHandler
impl UnwindSafe for BufferedHandler
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
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 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>
Wrap the input message
T in a tonic::Request