pub struct Matcher { /* private fields */ }Expand description
Go MerklePrefixMatcher: bounded (by groups and prefix entries, least recently used
first), expiring after the TTL, with no background task. Callers serialize access.
Implementations§
Source§impl Matcher
impl Matcher
Sourcepub fn reset(&mut self, limits: Limits)
pub fn reset(&mut self, limits: Limits)
A fresh matcher on limits that keeps counting access generations, so a lease
picked before the change never evicts a binding made after it.
pub fn limits(&self) -> Limits
Sourcepub fn find(
&mut self,
namespace: &str,
prepared: &Prepared,
now: Instant,
) -> Option<Match>
pub fn find( &mut self, namespace: &str, prepared: &Prepared, now: Instant, ) -> Option<Match>
Go MatchFingerprintsWithContext: the longest known prefix, a fork of it, or a
compaction continuation.
Sourcepub fn bind(
&mut self,
namespace: &str,
prepared: &Prepared,
auth: &str,
now: Instant,
) -> Option<Match>
pub fn bind( &mut self, namespace: &str, prepared: &Prepared, auth: &str, now: Instant, ) -> Option<Match>
Go BindFingerprintsWithContext: records the sequence for auth; the result
carries its session identity. None when nothing could be bound.
Sourcepub fn touch(
&mut self,
namespace: &str,
prepared: &Prepared,
auth: &str,
now: Instant,
) -> bool
pub fn touch( &mut self, namespace: &str, prepared: &Prepared, auth: &str, now: Instant, ) -> bool
Go TouchFingerprintsWithContext: refreshes the sequence if auth still owns it,
or binds a new extension. False when another credential took it over.
Sourcepub fn remove(
&mut self,
namespace: &str,
fingerprints: &[String],
auth: &str,
generation: u64,
now: Instant,
) -> bool
pub fn remove( &mut self, namespace: &str, fingerprints: &[String], auth: &str, generation: u64, now: Instant, ) -> bool
Go RemoveFingerprintsBefore: drops the exact sequence bound to auth unless it
was refreshed after generation (0: unconditionally).
Sourcepub fn invalidate(&mut self, auth: &str)
pub fn invalidate(&mut self, auth: &str)
Go InvalidateAuth.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Matcher
impl Freeze for Matcher
impl Move for Matcher
impl RefUnwindSafe for Matcher
impl Send for Matcher
impl Sync for Matcher
impl Unpin for Matcher
impl UnsafeUnpin for Matcher
impl UnwindSafe for Matcher
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more