pub struct BlockDisassembler { /* private fields */ }Expand description
Splits a response payload into Block2 chunks for incremental delivery.
RFC 7959 §2.4: The server sends the first block proactively, then the client requests subsequent blocks by including a Block2 option with the desired block number.
Implementations§
Source§impl BlockDisassembler
impl BlockDisassembler
Sourcepub fn get_block(&self, block_num: u32) -> Option<(Vec<u8>, BlockOption)>
pub fn get_block(&self, block_num: u32) -> Option<(Vec<u8>, BlockOption)>
Returns the block data and corresponding Block2 option for the given block number.
Returns None if block_num is beyond the last block.
Sourcepub fn total_blocks(&self) -> u32
pub fn total_blocks(&self) -> u32
Returns the total number of blocks required for this payload.
Sourcepub fn payload_len(&self) -> usize
pub fn payload_len(&self) -> usize
Returns the full payload length in bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BlockDisassembler
impl RefUnwindSafe for BlockDisassembler
impl Send for BlockDisassembler
impl Sync for BlockDisassembler
impl Unpin for BlockDisassembler
impl UnsafeUnpin for BlockDisassembler
impl UnwindSafe for BlockDisassembler
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