pub struct AnnotationBlock {
pub target_block_id: u32,
pub kind: AnnotationKind,
pub value: Vec<u8>,
}Expand description
ANNOTATION block — metadata overlay for other blocks.
Annotations are secondary blocks that attach metadata to a primary
block identified by target_block_id (the zero-based index of the
target block in the stream). The kind field determines how the
value payload should be interpreted:
Priority: value is aPrioritybyteSummary: value is UTF-8 text summarizing the target blockTag: value is a UTF-8 label/tag string
Field layout within body:
┌──────────┬───────────┬─────────────────┬──────────────────────┐
│ Field ID │ Wire Type │ Name │ Description │
├──────────┼───────────┼─────────────────┼──────────────────────┤
│ 1 │ Varint │ target_block_id │ Index of target blk │
│ 2 │ Varint │ kind │ AnnotationKind byte │
│ 3 │ Bytes │ value │ Annotation payload │
└──────────┴───────────┴─────────────────┴──────────────────────┘Fields§
§target_block_id: u32§kind: AnnotationKind§value: Vec<u8>Implementations§
Source§impl AnnotationBlock
impl AnnotationBlock
Sourcepub fn encode_body(&self) -> Vec<u8> ⓘ
pub fn encode_body(&self) -> Vec<u8> ⓘ
Serialize this block’s fields into a TLV-encoded body.
Sourcepub fn decode_body(buf: &[u8]) -> Result<Self, TypeError>
pub fn decode_body(buf: &[u8]) -> Result<Self, TypeError>
Deserialize an ANNOTATION block from a TLV-encoded body.
Trait Implementations§
Source§impl Clone for AnnotationBlock
impl Clone for AnnotationBlock
Source§fn clone(&self) -> AnnotationBlock
fn clone(&self) -> AnnotationBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnnotationBlock
impl Debug for AnnotationBlock
Source§impl PartialEq for AnnotationBlock
impl PartialEq for AnnotationBlock
impl Eq for AnnotationBlock
impl StructuralPartialEq for AnnotationBlock
Auto Trait Implementations§
impl Freeze for AnnotationBlock
impl RefUnwindSafe for AnnotationBlock
impl Send for AnnotationBlock
impl Sync for AnnotationBlock
impl Unpin for AnnotationBlock
impl UnsafeUnpin for AnnotationBlock
impl UnwindSafe for AnnotationBlock
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