pub struct AimxDispatch { /* private fields */ }Expand description
The shared AimX dispatch — authenticate (peer-only) + the AimxSession
factory. One Arc<AimxDispatch> is shared across every accepted connection.
Implementations§
Source§impl AimxDispatch
impl AimxDispatch
Sourcepub fn new(db: Arc<AimDb>, config: AimxConfig) -> Self
pub fn new(db: Arc<AimDb>, config: AimxConfig) -> Self
Build a dispatch over db with the given remote-access config.
Trait Implementations§
Source§impl Dispatch for AimxDispatch
impl Dispatch for AimxDispatch
Source§fn authenticate<'a>(
&'a self,
_peer: &'a PeerInfo,
_first: Option<&'a [u8]>,
) -> BoxFut<'a, Result<SessionCtx, AuthError>>
fn authenticate<'a>( &'a self, _peer: &'a PeerInfo, _first: Option<&'a [u8]>, ) -> BoxFut<'a, Result<SessionCtx, AuthError>>
Resolve a
SessionCtx from peer metadata and/or the first frame
(a pre-resolved identity in PeerInfo, or an in-band Hello in first).Source§fn open(&self, _ctx: &SessionCtx) -> Box<dyn Session>
fn open(&self, _ctx: &SessionCtx) -> Box<dyn Session>
Open the per-connection
Session once, after authenticate. It owns
the connection’s mutable dispatch state that the shared Arc<Self> cannot
hold behind &self; the engine threads &mut into it.Auto Trait Implementations§
impl !RefUnwindSafe for AimxDispatch
impl !UnwindSafe for AimxDispatch
impl Freeze for AimxDispatch
impl Send for AimxDispatch
impl Sync for AimxDispatch
impl Unpin for AimxDispatch
impl UnsafeUnpin for AimxDispatch
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