Skip to main content

MetaIteratorExt

Trait MetaIteratorExt 

Source
pub trait MetaIteratorExt<'a, M>
where M: 'a + Borrow<Meta1>,
{ // Required methods fn to_multi_map<K, KF>( self, path_to_key: KF, ) -> Result<HashMap<K, Vec<(usize, M)>>> where K: Hash + Eq, KF: Fn(&Path) -> Result<Option<K>>; fn to_unique_map<K, KF>( self, path_to_key: KF, ) -> Result<HashMap<K, (usize, M)>> where K: Hash + Eq, KF: Fn(&Path) -> Result<Option<K>>; }
Expand description

Constructs and returns map from syn::Meta iterator

Required Methods§

Source

fn to_multi_map<K, KF>( self, path_to_key: KF, ) -> Result<HashMap<K, Vec<(usize, M)>>>
where K: Hash + Eq, KF: Fn(&Path) -> Result<Option<K>>,

Constructs and returns a multi-value map from syn::Meta iterator

Source

fn to_unique_map<K, KF>(self, path_to_key: KF) -> Result<HashMap<K, (usize, M)>>
where K: Hash + Eq, KF: Fn(&Path) -> Result<Option<K>>,

Constructs and returns a unique-value map from syn::Meta iterator. Err if duplicates.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, I, M> MetaIteratorExt<'a, M> for I
where M: 'a + Borrow<Meta1>, I: Iterator<Item = (usize, M)>,