pub struct Block<B = Bytes> {
pub offset: u64,
pub data: B,
}Expand description
Re-export core types. Data block at a specific offset
The buffer type B is generic and can be any type that implements
AsRef<[u8]> + Send, allowing for:
bytes::Bytes— zero-copy slicesVec<u8>— owned buffersBox<[u8]>— boxed slices- DMA buffers
- Custom zero-copy types
The default buffer type is bytes::Bytes, which provides zero-copy
slices for I/O operations.
Fields§
§offset: u64Absolute byte offset where the block starts
data: BBuffer containing the block data
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Block<B>where
B: Freeze,
impl<B> RefUnwindSafe for Block<B>where
B: RefUnwindSafe,
impl<B> Send for Block<B>where
B: Send,
impl<B> Sync for Block<B>where
B: Sync,
impl<B> Unpin for Block<B>where
B: Unpin,
impl<B> UnwindSafe for Block<B>where
B: UnwindSafe,
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