Struct cbor_tag_index::TagIndex [−][src]
pub struct TagIndex<T> { /* fields omitted */ }
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
impl<T: Tag> TagIndex<T>
[src]
impl<T: Tag> TagIndex<T>
[src]pub fn new(
elements: impl IntoIterator<Item = impl IntoIterator<Item = T>>
) -> Result<Self>
[src]
elements: impl IntoIterator<Item = impl IntoIterator<Item = T>>
) -> Result<Self>
pub fn get<C: FromIterator<T>>(&self, index: usize) -> Option<C>
[src]
Trait Implementations
impl<T: DagCbor> Decode<DagCborCodec> for TagIndex<T>
[src]
impl<T: DagCbor> Decode<DagCborCodec> for TagIndex<T>
[src]impl<T: DagCbor> Encode<DagCborCodec> for TagIndex<T>
[src]
impl<T: DagCbor> Encode<DagCborCodec> for TagIndex<T>
[src]impl<T: Eq> Eq for TagIndex<T>
[src]
impl<T> StructuralEq for TagIndex<T>
[src]
impl<T> StructuralPartialEq for TagIndex<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for TagIndex<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for TagIndex<T> where
T: Send,
T: Send,
impl<T> Sync for TagIndex<T> where
T: Sync,
T: Sync,
impl<T> Unpin for TagIndex<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for TagIndex<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DagCbor for T where
T: Encode<DagCborCodec> + Decode<DagCborCodec>,
[src]
T: Encode<DagCborCodec> + Decode<DagCborCodec>,