Trait trillium_server_common::Server [−][src]
pub trait Server: Sized { type Transport: Transport; fn run<A, H>(config: Config<Self, A>, handler: H)
where
A: Acceptor<Self::Transport>,
H: Handler; fn run_async<'async_trait, A, H>(
config: Config<Self, A>,
handler: H
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
A: Acceptor<Self::Transport>,
H: Handler,
A: 'async_trait,
H: 'async_trait,
Self: 'async_trait; fn peer_ip(_transport: &Self::Transport) -> Option<IpAddr> { ... } }
Expand description
The server trait, for standard network-based server implementations.
Associated Types
Required methods
entrypoint to run a handler with a given config. if this function
is called, it is safe to assume that we are not yet within an
async runtime’s block_on. generally this should just entail a call
to my_runtime::block_on(Self::run_async(config, handler))
entrypoint to run a handler with a given config within a preexisting runtime