TlvData

Trait TlvData 

Source
pub trait TlvData<'a>: TryFrom<&'a [u32]>
where for<'b> Vec<u32>: From<&'b Self>,
{ // 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::::From(&Self) should be implemented as well to build the array of u32 element.

Required Methods§

Source

fn value_type(&self) -> u32

Return the value of type field. It should come from UAPI of Linux kernel.

Source

fn value_length(&self) -> usize

Return the length of value field. It should be in byte unit and multiples of 4 as result.

Source

fn value(&self) -> Vec<u32>

Generate vector with u32 element for raw data.

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.

Implementors§

Source§

impl<'a> TlvData<'a> for Chmap

Source§

impl<'a> TlvData<'a> for Container

Source§

impl<'a> TlvData<'a> for DbInterval

Source§

impl<'a> TlvData<'a> for DbRange

Source§

impl<'a> TlvData<'a> for DbScale