pub struct ChunkPlan { /* private fields */ }Expand description
A request/response-agnostic plan for splitting a known payload into chunks.
Implementations§
Source§impl ChunkPlan
impl ChunkPlan
Sourcepub const fn new(data_bytes: usize, slot_bytes: usize) -> Option<Self>
pub const fn new(data_bytes: usize, slot_bytes: usize) -> Option<Self>
Plan with the benchmark-backed 64 KiB target.
Sourcepub const fn for_slots(
data_bytes: usize,
slot_payload_bytes: usize,
slots_per_chunk: usize,
) -> Option<Self>
pub const fn for_slots( data_bytes: usize, slot_payload_bytes: usize, slots_per_chunk: usize, ) -> Option<Self>
Plan with a runtime-selected number of physical slots per chunk.
pub const fn data_bytes(self) -> usize
Sourcepub const fn chunk_bytes(self) -> usize
pub const fn chunk_bytes(self) -> usize
Maximum bytes in each full publication.
pub const fn chunk_count(self) -> usize
pub const fn slots_per_chunk(self) -> usize
Sourcepub const fn tail_bytes(self) -> usize
pub const fn tail_bytes(self) -> usize
Exact bytes in the last publication, or zero for an empty payload.
pub const fn tail_slots(self) -> usize
Trait Implementations§
impl Copy for ChunkPlan
impl Eq for ChunkPlan
impl StructuralPartialEq for ChunkPlan
Auto Trait Implementations§
impl Forget for ChunkPlan
impl Freeze for ChunkPlan
impl RefUnwindSafe for ChunkPlan
impl Send for ChunkPlan
impl Sync for ChunkPlan
impl Unpin for ChunkPlan
impl UnsafeUnpin for ChunkPlan
impl UnwindSafe for ChunkPlan
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