pub struct AuthzBloomFilter { /* private fields */ }Expand description
Thread-safe Bloom filter for authorization tuples
Implementations§
Source§impl AuthzBloomFilter
impl AuthzBloomFilter
Sourcepub fn with_config(config: BloomConfig) -> Self
pub fn with_config(config: BloomConfig) -> Self
Create a new Bloom filter with custom configuration
Sourcepub fn add_tuple(&self, tuple: &RelationTuple)
pub fn add_tuple(&self, tuple: &RelationTuple)
Add a tuple to the Bloom filter
Sourcepub fn might_contain(&self, request: &CheckRequest) -> bool
pub fn might_contain(&self, request: &CheckRequest) -> bool
Check if a tuple might exist (true = might exist, false = definitely doesn’t)
Sourcepub fn might_contain_batch(&self, requests: &[CheckRequest]) -> Vec<bool>
pub fn might_contain_batch(&self, requests: &[CheckRequest]) -> Vec<bool>
Batch check multiple requests Returns a vector of booleans indicating which requests might have tuples
Sourcepub fn item_count(&self) -> usize
pub fn item_count(&self) -> usize
Get the current item count
Sourcepub fn estimated_fp_rate(&self) -> f64
pub fn estimated_fp_rate(&self) -> f64
Get estimated false positive rate based on current fill
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AuthzBloomFilter
impl RefUnwindSafe for AuthzBloomFilter
impl Send for AuthzBloomFilter
impl Sync for AuthzBloomFilter
impl Unpin for AuthzBloomFilter
impl UnwindSafe for AuthzBloomFilter
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more