pub trait SessionFactory:
Clone
+ Send
+ Sync
+ 'static {
type Cfg: Clone + Send + 'static;
// Required methods
fn create_session<'life0, 'async_trait>(
&'life0 self,
dest: Address,
target: SessionTarget,
cfg: Self::Cfg,
) -> Pin<Box<dyn Future<Output = Result<(HoprSession, HoprSessionConfigurator), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn routing_from_cfg(
&self,
cfg: &Self::Cfg,
) -> Result<(Routing, Routing), Error>;
fn listener_limits(
&self,
cfg: &Self::Cfg,
) -> (Option<Bandwidth>, Option<ByteSize>);
fn session_idle_timeout(&self) -> Option<Duration>;
}Required Associated Types§
Required Methods§
Sourcefn create_session<'life0, 'async_trait>(
&'life0 self,
dest: Address,
target: SessionTarget,
cfg: Self::Cfg,
) -> Pin<Box<dyn Future<Output = Result<(HoprSession, HoprSessionConfigurator), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_session<'life0, 'async_trait>(
&'life0 self,
dest: Address,
target: SessionTarget,
cfg: Self::Cfg,
) -> Pin<Box<dyn Future<Output = Result<(HoprSession, HoprSessionConfigurator), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a new Session with the given destination, target and configuration.
Sourcefn routing_from_cfg(&self, cfg: &Self::Cfg) -> Result<(Routing, Routing), Error>
fn routing_from_cfg(&self, cfg: &Self::Cfg) -> Result<(Routing, Routing), Error>
Derives the forward and return routing options from the given configuration.
Sourcefn listener_limits(
&self,
cfg: &Self::Cfg,
) -> (Option<Bandwidth>, Option<ByteSize>)
fn listener_limits( &self, cfg: &Self::Cfg, ) -> (Option<Bandwidth>, Option<ByteSize>)
Derives the listener limits (max SURB upstream and response buffer) from the given configuration.
Sourcefn session_idle_timeout(&self) -> Option<Duration>
fn session_idle_timeout(&self) -> Option<Duration>
Returns the idle timeout duration for sessions created by this factory, if any.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.