OptionMap

Trait OptionMap 

Source
pub trait OptionMap
where Self: Map<OptNumber, Self::OptValues>,
{ type OptValue: Array<Item = u8> + AppendCopy<u8>; type OptValues: Array<Item = OptValue<Self::OptValue>>; // Provided methods fn opts(self) -> OptIter<Self, Self::IntoIter> { ... } fn opt_refs( &self, ) -> OptRefIter<'_, Self, Iter<'_, OptNumber, Self::OptValues>> { ... } }
Expand description

Generalization of HashMap<OptNumber, OptValue<Vec<u8>>>

Required Associated Types§

Source

type OptValue: Array<Item = u8> + AppendCopy<u8>

Byte array for option values

Source

type OptValues: Array<Item = OptValue<Self::OptValue>>

One or more values for a given number.

Note that not all options are repeatable.

Provided Methods§

Source

fn opts(self) -> OptIter<Self, Self::IntoIter>

Iterate over the map, yielding raw option structures

Source

fn opt_refs(&self) -> OptRefIter<'_, Self, Iter<'_, OptNumber, Self::OptValues>>

Iterate over the map, yielding raw option structures

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.

Implementations on Foreign Types§

Source§

impl OptionMap for BTreeMap<OptNumber, Vec<OptValue<Vec<u8>>>>

Available on crate feature alloc only.
Source§

impl<const MAX_OPTS: usize, const MAX_INSTANCES: usize, const MAX_BYTES_PER_INSTANCE: usize> OptionMap for ArrayVec<[(OptNumber, ArrayVec<[OptValue<ArrayVec<[u8; MAX_BYTES_PER_INSTANCE]>>; MAX_INSTANCES]>); N]>

Implementors§