pub struct StructuredDataBlock {
pub format: DataFormat,
pub schema: Option<String>,
pub content: Vec<u8>,
}Expand description
STRUCTURED_DATA block — represents tables, JSON, configs, etc.
Used for any structured content that isn’t source code: API responses,
configuration files, CSV datasets, YAML manifests. The format field
tells the renderer which parser/highlighter to apply.
Field layout within body:
┌──────────┬───────────┬─────────┬──────────────────────────────┐
│ Field ID │ Wire Type │ Name │ Description │
├──────────┼───────────┼─────────┼──────────────────────────────┤
│ 1 │ Varint │ format │ DataFormat enum byte │
│ 2 │ Bytes │ schema │ Optional schema descriptor │
│ 3 │ Bytes │ content │ Raw data bytes │
└──────────┴───────────┴─────────┴──────────────────────────────┘Fields§
§format: DataFormat§schema: Option<String>Optional schema descriptor (e.g. a JSON Schema URI or inline schema).
content: Vec<u8>Implementations§
Source§impl StructuredDataBlock
impl StructuredDataBlock
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 a STRUCTURED_DATA block from a TLV-encoded body.
Trait Implementations§
Source§impl Clone for StructuredDataBlock
impl Clone for StructuredDataBlock
Source§fn clone(&self) -> StructuredDataBlock
fn clone(&self) -> StructuredDataBlock
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 StructuredDataBlock
impl Debug for StructuredDataBlock
Source§impl PartialEq for StructuredDataBlock
impl PartialEq for StructuredDataBlock
impl Eq for StructuredDataBlock
impl StructuralPartialEq for StructuredDataBlock
Auto Trait Implementations§
impl Freeze for StructuredDataBlock
impl RefUnwindSafe for StructuredDataBlock
impl Send for StructuredDataBlock
impl Sync for StructuredDataBlock
impl Unpin for StructuredDataBlock
impl UnsafeUnpin for StructuredDataBlock
impl UnwindSafe for StructuredDataBlock
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