pub struct HighBitset(/* private fields */);Expand description
Fixed-width bitset over high-value (legalese) token IDs.
Legalese tokens occupy the reserved low ID range 0..len_legalese, so a
rule’s (or query’s) high-token set maps onto one bit per ID. Intersection
count is then a word-wise AND + popcount, which replaces the sorted
two-pointer merge walk in the candidate-selection high-token gate — a
branch-free, allocation-free, constant-per-rule cost regardless of set size.
All bitsets compared together MUST share the same width (len_legalese).
Implementations§
Source§impl HighBitset
impl HighBitset
Sourcepub fn from_token_set(set: &TokenSet, len_legalese: usize) -> Self
pub fn from_token_set(set: &TokenSet, len_legalese: usize) -> Self
Build a bitset of len_legalese bits with the high tokens of set set.
set is expected to contain only high token IDs (< len_legalese); any
out-of-range ID would be a builder invariant violation, so it is ignored
rather than panicking in the hot path.
Sourcepub fn intersection_count(&self, other: &HighBitset) -> usize
pub fn intersection_count(&self, other: &HighBitset) -> usize
Count of shared bits with other. Both bitsets must share a width
(built from the same len_legalese); zip would otherwise silently
truncate to the shorter operand and undercount.
Trait Implementations§
Source§impl Archive for HighBitset
impl Archive for HighBitset
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§impl Clone for HighBitset
impl Clone for HighBitset
Source§fn clone(&self) -> HighBitset
fn clone(&self) -> HighBitset
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HighBitset
impl Debug for HighBitset
Source§impl<__D: Fallible + ?Sized> Deserialize<HighBitset, __D> for Archived<HighBitset>
impl<__D: Fallible + ?Sized> Deserialize<HighBitset, __D> for Archived<HighBitset>
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<HighBitset, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<HighBitset, <__D as Fallible>::Error>
impl Eq for HighBitset
Source§impl PartialEq for HighBitset
impl PartialEq for HighBitset
Source§fn eq(&self, other: &HighBitset) -> bool
fn eq(&self, other: &HighBitset) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HighBitset
Auto Trait Implementations§
impl Freeze for HighBitset
impl RefUnwindSafe for HighBitset
impl Send for HighBitset
impl Sync for HighBitset
impl Unpin for HighBitset
impl UnsafeUnpin for HighBitset
impl UnwindSafe for HighBitset
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T, S> SerializeUnsized<S> for T
impl<T, S> SerializeUnsized<S> for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.