Skip to main content

HoprSessionServer

Trait HoprSessionServer 

pub trait HoprSessionServer {
    type Session: Send;
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn process<'life0, 'async_trait>(
        &'life0 self,
        session: Self::Session,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Trait for processing incoming HOPR sessions on exit nodes.

The concrete session type is defined by the implementor (typically hopr-lib), keeping transport-level types out of the API crate.

Nodes that do not run a session server simply omit calling with_session_server.

Required Associated Types§

type Session: Send

An incoming session to be processed.

type Error: Error + Send + Sync + 'static

Error type for session processing.

Required Methods§

fn process<'life0, 'async_trait>( &'life0 self, session: Self::Session, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Fully process a single incoming HOPR session.

Implementations on Foreign Types§

§

impl<T> HoprSessionServer for Arc<T>

§

type Session = <T as HoprSessionServer>::Session

§

type Error = <T as HoprSessionServer>::Error

§

fn process<'life0, 'async_trait>( &'life0 self, session: <Arc<T> as HoprSessionServer>::Session, ) -> Pin<Box<dyn Future<Output = Result<(), <Arc<T> as HoprSessionServer>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Implementors§