Skip to main content

SessionServerConnector

Struct SessionServerConnector 

Source
pub struct SessionServerConnector<C, LF, DF> { /* private fields */ }
Expand description

Accepts connections from a Listener L and serves them with a dispatch, speaking codec C, under a logical scheme.

Two factories keep it transport- and protocol-agnostic:

  • listener_factory runs at build time and returns DbResult<L>, so the bind happens there and any error surfaces synchronously from build.
  • dispatch_factory turns the live &AimDb into an Arc<dyn Dispatch> (e.g. an AimxDispatch), so the spine never names a concrete protocol.

Implementations§

Source§

impl<C, LF, DF> SessionServerConnector<C, LF, DF>

Source

pub fn new( listener_factory: LF, codec: C, dispatch_factory: DF, config: SessionConfig, ) -> Self

Build a server connector. listener_factory binds the listener at build time; dispatch_factory produces the per-server dispatch from the live db. The scheme defaults to "remote".

Source

pub fn scheme(self, scheme: impl Into<String>) -> Self

Override the scheme this connector registers.

Trait Implementations§

Source§

impl<L, C, LF, DF> ConnectorBuilder for SessionServerConnector<C, LF, DF>
where L: Listener + 'static, C: EnvelopeCodec + Clone + 'static, LF: Fn() -> DbResult<L> + Send + Sync + 'static, DF: Fn(&AimDb) -> Arc<dyn Dispatch> + Send + Sync + 'static,

Source§

fn build<'a>( &'a self, db: &'a AimDb, ) -> Pin<Box<dyn Future<Output = DbResult<Vec<Pin<Box<dyn Future<Output = ()> + Send + 'static>>>>> + Send + 'a>>

Build the connector and return its driving futures. Read more
Source§

fn scheme(&self) -> &str

The URL scheme this connector handles Read more
Source§

fn owns_scheme(&self) -> bool

Whether registering a second connector under this scheme is an error. Read more

Auto Trait Implementations§

§

impl<C, LF, DF> Freeze for SessionServerConnector<C, LF, DF>
where LF: Freeze, C: Freeze, DF: Freeze,

§

impl<C, LF, DF> RefUnwindSafe for SessionServerConnector<C, LF, DF>

§

impl<C, LF, DF> Send for SessionServerConnector<C, LF, DF>
where LF: Send, C: Send, DF: Send,

§

impl<C, LF, DF> Sync for SessionServerConnector<C, LF, DF>
where LF: Sync, C: Sync, DF: Sync,

§

impl<C, LF, DF> Unpin for SessionServerConnector<C, LF, DF>
where LF: Unpin, C: Unpin, DF: Unpin,

§

impl<C, LF, DF> UnsafeUnpin for SessionServerConnector<C, LF, DF>
where LF: UnsafeUnpin, C: UnsafeUnpin, DF: UnsafeUnpin,

§

impl<C, LF, DF> UnwindSafe for SessionServerConnector<C, LF, DF>
where LF: UnwindSafe, C: UnwindSafe, DF: UnwindSafe,

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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