#[repr(u8)]pub enum TLVValueType {
Show 25 variants
S8 = 0,
S16 = 1,
S32 = 2,
S64 = 3,
U8 = 4,
U16 = 5,
U32 = 6,
U64 = 7,
False = 8,
True = 9,
F32 = 10,
F64 = 11,
Utf8l = 12,
Utf16l = 13,
Utf32l = 14,
Utf64l = 15,
Str8l = 16,
Str16l = 17,
Str32l = 18,
Str64l = 19,
Null = 20,
Struct = 21,
Array = 22,
List = 23,
EndCnt = 24,
}Expand description
Represents the TLV value type encoded in the control byte of each TLV element.
Variants§
S8 = 0
S16 = 1
S32 = 2
S64 = 3
U8 = 4
U16 = 5
U32 = 6
U64 = 7
False = 8
True = 9
F32 = 10
F64 = 11
Utf8l = 12
Utf16l = 13
Utf32l = 14
Utf64l = 15
Str8l = 16
Str16l = 17
Str32l = 18
Str64l = 19
Null = 20
Struct = 21
Array = 22
List = 23
EndCnt = 24
Implementations§
Source§impl TLVValueType
impl TLVValueType
Sourcepub const fn fixed_size(&self) -> Option<usize>
pub const fn fixed_size(&self) -> Option<usize>
Return the size of the value corresponding to this value type.
If the value type has a variable size (i.e. octet and Utf8 strings), this function returns None.
Sourcepub const fn variable_size_len(&self) -> usize
pub const fn variable_size_len(&self) -> usize
Return the size of the length field for variable size value types.
if the value type has a fixed size, this function returns 0. Variable size types are only octet strings and utf8 strings.
Sourcepub const fn is_container(&self) -> bool
pub const fn is_container(&self) -> bool
Convenience method to check if the value type is a container type (container start or end).
Sourcepub const fn is_container_start(&self) -> bool
pub const fn is_container_start(&self) -> bool
Convenience method to check if the value type is a container start type.
Sourcepub const fn is_container_end(&self) -> bool
pub const fn is_container_end(&self) -> bool
Convenience method to check if the value type is a container end type.
Sourcepub const fn is_str(&self) -> bool
pub const fn is_str(&self) -> bool
Convenience method to check if the value type is an Octet String type.
Sourcepub const fn is_utf8(&self) -> bool
pub const fn is_utf8(&self) -> bool
Convenience method to check if the value type is a UTF-8 String type.
pub fn container_value<'a>(&self) -> Result<TLVValue<'a>, Error>
Trait Implementations§
Source§impl Clone for TLVValueType
impl Clone for TLVValueType
Source§fn clone(&self) -> TLVValueType
fn clone(&self) -> TLVValueType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TLVValueType
Source§impl Debug for TLVValueType
impl Debug for TLVValueType
Source§impl Display for TLVValueType
impl Display for TLVValueType
impl Eq for TLVValueType
Source§impl FromPrimitive for TLVValueType
impl FromPrimitive for TLVValueType
Source§fn from_i64(n: i64) -> Option<TLVValueType>
fn from_i64(n: i64) -> Option<TLVValueType>
i64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u64(n: u64) -> Option<TLVValueType>
fn from_u64(n: u64) -> Option<TLVValueType>
u64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
isize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
i8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
i16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
i32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
i128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
usize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
u8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
u16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
u32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
u128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§impl Hash for TLVValueType
impl Hash for TLVValueType
Source§impl Ord for TLVValueType
impl Ord for TLVValueType
Source§fn cmp(&self, other: &TLVValueType) -> Ordering
fn cmp(&self, other: &TLVValueType) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TLVValueType
impl PartialEq for TLVValueType
Source§impl PartialOrd for TLVValueType
impl PartialOrd for TLVValueType
impl StructuralPartialEq for TLVValueType
Auto Trait Implementations§
impl Freeze for TLVValueType
impl RefUnwindSafe for TLVValueType
impl Send for TLVValueType
impl Sync for TLVValueType
impl Unpin for TLVValueType
impl UnsafeUnpin for TLVValueType
impl UnwindSafe for TLVValueType
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more