pub struct SendBatchRaw { /* private fields */ }Expand description
A raw send batch with dynamic capacity.
This is the underlying type behind SendBatch<N>. It manages a
dynamically-allocated slot array. The typed SendBatch<N> wrapper
provides a compile-time capacity via std::ops::DerefMut to this type.
Most users should use SendBatch<N> instead.
Implementations§
Source§impl SendBatchRaw
impl SendBatchRaw
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new raw send batch with the given capacity.
The internal slot vector is pre-allocated to capacity elements.
Sourcepub fn push(
&mut self,
data: &[u8],
addr: Option<SocketAddr>,
) -> Result<(), BingerError>
pub fn push( &mut self, data: &[u8], addr: Option<SocketAddr>, ) -> Result<(), BingerError>
Pushes a buffer and optional destination address into the raw send batch.
When addr is None, the packet will be sent on a connected socket
(equivalent to SendBatch::push_connected). When addr is Some(...),
the packet is sent to that specific address (connectionless mode).
§Errors
Returns BingerError::BatchFull if the batch has reached its capacity.
Auto Trait Implementations§
impl !Send for SendBatchRaw
impl !Sync for SendBatchRaw
impl Freeze for SendBatchRaw
impl RefUnwindSafe for SendBatchRaw
impl Unpin for SendBatchRaw
impl UnsafeUnpin for SendBatchRaw
impl UnwindSafe for SendBatchRaw
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