Enum capsules_extra::net::thread::tlv::NetworkDataTlv
source · pub enum NetworkDataTlv<'a> {
Prefix {
domain_id: u8,
prefix_length_bits: u8,
prefix: [u8; 3],
sub_tlvs: &'a [u8],
},
CommissioningData {
com_length: u8,
com_data: [u8; 128],
},
Service {
thread_enterprise_number: bool,
s_id: u8,
s_enterprise_number: u32,
s_service_data_length: u8,
s_service_data: [u8; 128],
sub_tlvs: &'a [u8],
},
}
Expand description
These TLVs are contained within the value of a Network Data TLV. See Section 5.18.
Variants§
Implementations§
source§impl NetworkDataTlv<'_>
impl NetworkDataTlv<'_>
sourcepub fn encode(&self, buf: &mut [u8], stable: bool) -> SResult
pub fn encode(&self, buf: &mut [u8], stable: bool) -> SResult
Serializes TLV data in buf
into the format specific to the
Network Data TLV type.
sourcepub fn decode(buf: &[u8]) -> SResult<(NetworkDataTlv<'_>, bool)>
pub fn decode(buf: &[u8]) -> SResult<(NetworkDataTlv<'_>, bool)>
Deserializes TLV data from buf
into the Network Data TLV variant
specific to the TLV type.
Returns NetworkDataTlv and true if the data stable, false
otherwise.
SResult::Error
is returned if the type field does not match any
implemented TLV type.
Trait Implementations§
source§impl From<&NetworkDataTlv<'_>> for NetworkDataTlvType
impl From<&NetworkDataTlv<'_>> for NetworkDataTlvType
source§fn from(network_data_tlv: &NetworkDataTlv<'_>) -> Self
fn from(network_data_tlv: &NetworkDataTlv<'_>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for NetworkDataTlv<'a>
impl<'a> RefUnwindSafe for NetworkDataTlv<'a>
impl<'a> Send for NetworkDataTlv<'a>
impl<'a> Sync for NetworkDataTlv<'a>
impl<'a> Unpin for NetworkDataTlv<'a>
impl<'a> UnwindSafe for NetworkDataTlv<'a>
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