pub struct TraceSet(/* private fields */);Expand description
A set of trace categories stored as one bit per category.
Input: categories through with or FromIterator. Output: contains.
bits and from_bits round-trip it for storage without serde.
Implementations§
Source§impl TraceSet
impl TraceSet
Sourcepub const fn all() -> TraceSet
pub const fn all() -> TraceSet
Returns the set of every category. Input: none. Output: the full set.
Sourcepub const fn none() -> TraceSet
pub const fn none() -> TraceSet
Returns the empty set. Input: none. Output: a set that contains nothing.
Sourcepub const fn with(self, t: Trace) -> TraceSet
pub const fn with(self, t: Trace) -> TraceSet
Returns this set with t added.
Input: one category. Output: the larger set.
Sourcepub const fn contains(self, t: Trace) -> bool
pub const fn contains(self, t: Trace) -> bool
Returns whether the set holds t.
Input: one category. Output: true when present.
Sourcepub const fn union(self, other: TraceSet) -> TraceSet
pub const fn union(self, other: TraceSet) -> TraceSet
Returns every category in either set. Input: another set. Output: the union.
Sourcepub const fn is_empty(self) -> bool
pub const fn is_empty(self) -> bool
Returns whether the set holds no category. Input: none. Output: true when empty.
Sourcepub const fn bits(self) -> u32
pub const fn bits(self) -> u32
Returns the raw bits, one per category in Trace::ALL order.
Input: none. Output: the bits; from_bits reads them back.