pub struct RawDataItem {
pub type_id: DataItemType,
pub value: Bytes,
}Expand description
Low-level, untyped TLV data item. Useful for forward-compat and for extensions that carry their own value encoding.
Fields§
§type_id: DataItemType§value: BytesImplementations§
Source§impl RawDataItem
impl RawDataItem
Sourcepub fn encode(&self, out: &mut BytesMut) -> Result<(), CodecError>
pub fn encode(&self, out: &mut BytesMut) -> Result<(), CodecError>
Encode this raw TLV onto out. Validates the value length upfront —
extension/forward-compat callers using DataItem::Unknown(raw) must
not silently truncate when value.len() > u16::MAX.
pub fn decode(src: &mut Bytes) -> Result<Self, CodecError>
Trait Implementations§
Source§impl Clone for RawDataItem
impl Clone for RawDataItem
Auto Trait Implementations§
impl !Freeze for RawDataItem
impl RefUnwindSafe for RawDataItem
impl Send for RawDataItem
impl Sync for RawDataItem
impl Unpin for RawDataItem
impl UnsafeUnpin for RawDataItem
impl UnwindSafe for RawDataItem
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