Struct cbor_tag_index::TagIndex
source · [−]pub struct TagIndex<T> { /* private fields */ }
Expand description
A tag index, a sequence of tag sets that internally uses bitmaps to encode the distinct tag sets, and a vector of offsets for each event.
To be used with DnfQuery.
A sequence with the following tag sets:
[{"a"}, {"a", "b"}, {"b","c"}, {"a"}]
would be encoded like this:
{
tags: {
tags: [ "a", "b", "c" ],
sets: [
b001, // a
b010, // b
b110, // cb
],
},
events: [
0, // first bitset
1, // 2nd bitset
2, // 3rd bitset
0, // first bitset again
],
}
Implementations
sourceimpl<T: Tag> TagIndex<T>
impl<T: Tag> TagIndex<T>
pub fn new(
elements: impl IntoIterator<Item = impl IntoIterator<Item = T>>
) -> Result<Self>
pub fn get<C: FromIterator<T>>(&self, index: usize) -> Option<C>
Trait Implementations
sourceimpl<T: PartialEq> PartialEq<TagIndex<T>> for TagIndex<T>
impl<T: PartialEq> PartialEq<TagIndex<T>> for TagIndex<T>
impl<T: Eq> Eq for TagIndex<T>
impl<T> StructuralEq for TagIndex<T>
impl<T> StructuralPartialEq for TagIndex<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for TagIndex<T>where
T: RefUnwindSafe,
impl<T> Send for TagIndex<T>where
T: Send,
impl<T> Sync for TagIndex<T>where
T: Sync,
impl<T> Unpin for TagIndex<T>where
T: Unpin,
impl<T> UnwindSafe for TagIndex<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more