pub struct PairingGate { /* private fields */ }Implementations§
Source§impl PairingGate
impl PairingGate
pub fn new(store: Arc<PairingStore>) -> Self
pub fn with_cache_ttl(self, ttl: Duration) -> Self
Sourcepub fn flush_cache(&self)
pub fn flush_cache(&self)
Drop every cached decision. The next call for any sender will re-query the store. Cheap (single dashmap clear).
Sourcepub async fn should_admit(
&self,
channel: &str,
account_id: &str,
sender_id: &str,
policy: &PairingPolicy,
adapter: Option<&dyn PairingChannelAdapter>,
) -> Result<Decision, PairingError>
pub async fn should_admit( &self, channel: &str, account_id: &str, sender_id: &str, policy: &PairingPolicy, adapter: Option<&dyn PairingChannelAdapter>, ) -> Result<Decision, PairingError>
Hot path. Returns the decision the plugin should act on. Errors
only on storage failures — those get logged and are treated as
Drop by the caller (fail-closed).
Auto Trait Implementations§
impl Freeze for PairingGate
impl !RefUnwindSafe for PairingGate
impl Send for PairingGate
impl Sync for PairingGate
impl Unpin for PairingGate
impl UnsafeUnpin for PairingGate
impl !UnwindSafe for PairingGate
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