pub struct BlockSize<const L: usize, const F: usize>;
Expand description
Custom Block Size
In channels, items are stored in contiguous blocks (chunks) of item slots. New blocks are allocated as items are sent through the channel. A large block size will result in less but bigger allocations. A small block size will result in more, smaller allocations. For channels transporting large amounts of items, a large block size is preferred. This structure allows you to create channels with custom block size (chunk length).
See the following pre-defined block sizes:
SmallBlockSize
: 8 slots per blockDefaultBlockSize
: 32 slots per blockLargeBlockSize
: 4096 slots per blockHugeBlockSize
: 1048576 slots per block
L must be equal to F x 8
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<const L: usize, const F: usize> Freeze for BlockSize<L, F>
impl<const L: usize, const F: usize> RefUnwindSafe for BlockSize<L, F>
impl<const L: usize, const F: usize> Send for BlockSize<L, F>
impl<const L: usize, const F: usize> Sync for BlockSize<L, F>
impl<const L: usize, const F: usize> Unpin for BlockSize<L, F>
impl<const L: usize, const F: usize> UnwindSafe for BlockSize<L, F>
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