Skip to main content

Matcher

Struct Matcher 

Source
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

Source

pub fn new(limits: Limits) -> Self

Go NewMerklePrefixMatcherWithConfig, defaults included.

Source

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.

Source

pub fn limits(&self) -> Limits

Source

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.

Source

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.

Source

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.

Source

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).

Source

pub fn invalidate(&mut self, auth: &str)

Go InvalidateAuth.

Source

pub fn retain(&mut self, keep: impl Fn(&str) -> bool)

Drops the bindings of credentials keep rejects (removed credentials).

Source

pub fn clear(&mut self)

Go Clear; the access counter keeps counting.

Source

pub fn lookup( &mut self, session: &str, now: Instant, ) -> Option<(Vec<String>, String)>

Go LookupSession: the credentials bound to an LCP session (sorted) and its namespace, without refreshing anything; expired groups are dropped.

Trait Implementations§

Source§

impl Default for Matcher

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more