pub struct Block {
pub block_type: BlockType,
pub flags: BlockFlags,
pub summary: Option<Summary>,
pub content: BlockContent,
}Expand description
A fully parsed BCP block — the union of all block types with optional metadata.
This is the primary type that higher-level crates (bcp-encoder,
bcp-decoder, bcp-driver) work with. It combines the block’s
type tag, per-block flags, optional summary, and typed content
into a single value.
The Block struct sits between the wire layer (BlockFrame from
bcp-wire) and the application layer. The encoder converts a
Block into a BlockFrame by calling content.encode_body()
and prepending the summary if present. The decoder does the reverse:
it reads a BlockFrame, strips the summary if flags.has_summary(),
then dispatches to the appropriate decode_body method based on
block_type.
Fields§
§block_type: BlockType§flags: BlockFlags§summary: Option<Summary>§content: BlockContentTrait Implementations§
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl UnwindSafe for Block
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