pub struct EndBlock;Expand description
END sentinel — marks the end of the block stream.
The END block has no fields and no body. Its presence on the wire is
signaled solely by the block type byte (0xFF) in the block frame
header. The bcp_wire::BlockFrame::read_from method returns None
when it encounters an END block, terminating the read loop.
Unlike other block types that carry TLV-encoded fields, EndBlock
is a zero-field struct. Its encode_body always returns an empty
vec and its decode_body succeeds only on empty input.
Wire layout:
┌──────────────────────────────────────┐
│ block_type = 0xFF (varint, 2 bytes) │
│ (no flags, no content_len, no body) │
└──────────────────────────────────────┘Implementations§
Source§impl EndBlock
impl EndBlock
Sourcepub fn encode_body(&self) -> Vec<u8> ⓘ
pub fn encode_body(&self) -> Vec<u8> ⓘ
Serialize the END block body — always empty.
Sourcepub fn decode_body(_buf: &[u8]) -> Result<Self, TypeError>
pub fn decode_body(_buf: &[u8]) -> Result<Self, TypeError>
Deserialize an END block from a body buffer.
Succeeds on empty input. Non-empty input is accepted but ignored, since a future spec revision could attach trailing metadata to the END sentinel.
Trait Implementations§
impl Eq for EndBlock
impl StructuralPartialEq for EndBlock
Auto Trait Implementations§
impl Freeze for EndBlock
impl RefUnwindSafe for EndBlock
impl Send for EndBlock
impl Sync for EndBlock
impl Unpin for EndBlock
impl UnsafeUnpin for EndBlock
impl UnwindSafe for EndBlock
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