pub struct DnfQuery<T> { /* private fields */ }
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

An empty dnf query which matches nothing

Are we an empty dnf query which matches nothing?

a dnf query containing an empty set, which matches everything

Are we a dnf query containing an empty set, which matches everything?

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.

Build a new DnfQuery from a sequence of terms, where each term contains a sequence of tags.

Helper method to return the matching indexes, mostly for tests

given a bitmap of matches, corresponding to the events in the index, set those bytes to false that do not match.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Decode from an impl Read. Read more
Returns the “default value” for a type. Read more
Formats the value using the given formatter. Read more
Encodes into a impl Write. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Scrape the references from an impl Read. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.