Trait tide_disco::app::Listener
pub trait Listener<State>: Debug + Display + Send + Sync + 'static{
// Required methods
fn bind<'life0, 'async_trait>(
&'life0 mut self,
app: Server<State>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn accept<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn info(&self) -> Vec<ListenInfo>;
}
Expand description
The Listener trait represents an implementation of http transport for a tide
application. In order to provide a Listener to tide, you will also need to
implement at least one ToListener
that
outputs your Listener type.
Required Methods§
fn bind<'life0, 'async_trait>(
&'life0 mut self,
app: Server<State>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn bind<'life0, 'async_trait>(
&'life0 mut self,
app: Server<State>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Bind the listener. This starts the listening process by opening the
necessary network ports, but not yet accepting incoming connections. This
method must be called before accept
.