Struct Tlv
pub struct Tlv {
pub kind: u8,
pub value: Bytes,
}Expand description
One TLV.
Fields§
§kind: u8Type of the TLV.
value: BytesValue of the TLV.
Implementations§
§impl Tlv
impl Tlv
pub fn decode<T: Decode>(self) -> Result<T, DecodeError>
pub fn decode<T: Decode>(self) -> Result<T, DecodeError>
Decodes the value.
§Errors
Returns DecodeError::InvalidValue if the value is invalid, or
DecodeError::TrailingBytes if it doesn’t use the whole TLV.
Trait Implementations§
impl Eq for Tlv
impl StructuralPartialEq for Tlv
Auto Trait Implementations§
impl !Freeze for Tlv
impl RefUnwindSafe for Tlv
impl Send for Tlv
impl Sync for Tlv
impl Unpin for Tlv
impl UnsafeUnpin for Tlv
impl UnwindSafe for Tlv
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