Skip to main content

AdmissionGate

Trait AdmissionGate 

Source
pub trait AdmissionGate:
    Send
    + Sync
    + 'static {
    // Required methods
    fn admit<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        hello: &'life1 VerifiedHello,
        ctx: &'life2 AdmitContext,
    ) -> Pin<Box<dyn Future<Output = Admission> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn admit_unverified<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        failure: &'life1 HelloFailure,
        ctx: &'life2 AdmitContext,
    ) -> Pin<Box<dyn Future<Output = Admission> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn strict(&self) -> bool { ... }
    fn is_revoked(&self, _node_id: &str) -> bool { ... }
}
Expand description

Admission policy for the mesh listener.

Required Methods§

Source

fn admit<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, hello: &'life1 VerifiedHello, ctx: &'life2 AdmitContext, ) -> Pin<Box<dyn Future<Output = Admission> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

A hello verified; decide.

Source

fn admit_unverified<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, failure: &'life1 HelloFailure, ctx: &'life2 AdmitContext, ) -> Pin<Box<dyn Future<Output = Admission> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

No hello, or it failed verification; decide.

Provided Methods§

Source

fn strict(&self) -> bool

True when the listener should apply the idle limit and the live revocation check (a gate that actually checks peers). The per-IP cap and first-frame timeout apply under every gate. AllowAll is false so quiet legacy leaves are not cut off once connected.

Source

fn is_revoked(&self, _node_id: &str) -> bool

Whether an admitted peer has since been revoked and must be cut off (re-checked on every frame). Only gates that refuse revoked peers at admission say yes; the default never does.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§