pub struct BufferSender { /* private fields */ }Expand description
A sender handle to a memory buffer.
Implementations§
Source§impl BufferSender
impl BufferSender
Sourcepub async fn send(&self, batch: EventBatch) -> Result<(), SendError<EventBatch>>
pub async fn send(&self, batch: EventBatch) -> Result<(), SendError<EventBatch>>
Sends a batch to the buffer.
If the buffer is full and when_full is Block, this will await until space is available,
propagating backpressure upstream.
Sourcepub fn max_capacity(&self) -> usize
pub fn max_capacity(&self) -> usize
Returns the maximum capacity of the buffer.
Sourcepub fn utilization(&self) -> f64
pub fn utilization(&self) -> f64
Returns the utilization of the buffer as a fraction between 0.0 and 1.0.
Sourcepub fn try_send(
&self,
batch: EventBatch,
) -> Result<(), TrySendError<EventBatch>>
pub fn try_send( &self, batch: EventBatch, ) -> Result<(), TrySendError<EventBatch>>
Try to send without blocking. Returns an error if full.
Trait Implementations§
Source§impl Clone for BufferSender
impl Clone for BufferSender
Source§fn clone(&self) -> BufferSender
fn clone(&self) -> BufferSender
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BufferSender
impl RefUnwindSafe for BufferSender
impl Send for BufferSender
impl Sync for BufferSender
impl Unpin for BufferSender
impl UnsafeUnpin for BufferSender
impl UnwindSafe for BufferSender
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