Struct cbor_tag_index::DnfQuery [−][src]
pub struct DnfQuery<T> { /* fields omitted */ }
Expand description
A compact representation of a seq of tag sets, to be used as a DNF query.
The internal repesentation is using a bitmap for efficiency. So assuming string tags, e.g. (“a” & “b”) | (“b” & “c”) | (“d”) would be encoded as
{
tags: ["a", "b", "c", "d"],
sets: [
b0011,
b0110,
b1000,
]
}
so the possibly large tags have to be stored only once, and operations can work on bit sets.
Implementations
impl<T> DnfQuery<T>
[src]
impl<T> DnfQuery<T>
[src]pub fn is_all(&self) -> bool
[src]
pub fn is_all(&self) -> bool
[src]Are we a dnf query containing an empty set, which matches everything?
pub fn terms(&self) -> impl Iterator<Item = impl Iterator<Item = &T>>
[src]
pub fn terms(&self) -> impl Iterator<Item = impl Iterator<Item = &T>>
[src]get back the terms making up the dnf query
Note that there is no guarantee that there will be the same number of terms or that tags in each term will be ordered in the same way.
pub fn len(&self) -> usize
[src]
impl<T: Tag> DnfQuery<T>
[src]
impl<T: Tag> DnfQuery<T>
[src]pub fn new(
terms: impl IntoIterator<Item = impl IntoIterator<Item = T>>
) -> Result<Self>
[src]
pub fn new(
terms: impl IntoIterator<Item = impl IntoIterator<Item = T>>
) -> Result<Self>
[src]Build a new DnfQuery from a sequence of terms, where each term contains a sequence of tags.
Trait Implementations
impl<T: DagCbor> Decode<DagCborCodec> for DnfQuery<T>
[src]
impl<T: DagCbor> Decode<DagCborCodec> for DnfQuery<T>
[src]impl<T: DagCbor> Encode<DagCborCodec> for DnfQuery<T>
[src]
impl<T: DagCbor> Encode<DagCborCodec> for DnfQuery<T>
[src]impl<T: Eq> Eq for DnfQuery<T>
[src]
impl<T> StructuralEq for DnfQuery<T>
[src]
impl<T> StructuralPartialEq for DnfQuery<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for DnfQuery<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for DnfQuery<T> where
T: Send,
T: Send,
impl<T> Sync for DnfQuery<T> where
T: Sync,
T: Sync,
impl<T> Unpin for DnfQuery<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for DnfQuery<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>,