pub trait TlvData<'a>: TryFrom<&'a [u32]>{
// Required methods
fn value_type(&self) -> u32;
fn value_length(&self) -> usize;
fn value(&self) -> Vec<u32>;
}Expand description
The trait for common methods to data of TLV (Type-Length-Value) in ALSA control interface.
The TryFrom supertrait should be implemented to parse the array of u32 elements and it
can return TlvDecodeError at failure. The trait boundary to Vec::
Required Methods§
Sourcefn value_type(&self) -> u32
fn value_type(&self) -> u32
Return the value of type field. It should come from UAPI of Linux kernel.
Sourcefn value_length(&self) -> usize
fn value_length(&self) -> usize
Return the length of value field. It should be in byte unit and multiples of 4 as result.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.