rocket/listener/
bind.rs

1use std::error::Error;
2
3use crate::listener::{Endpoint, Listener};
4use crate::{Rocket, Ignite};
5
6pub trait Bind: Listener + 'static {
7    type Error: Error + Send + 'static;
8
9    #[crate::async_bound(Send)]
10    async fn bind(rocket: &Rocket<Ignite>) -> Result<Self, Self::Error>;
11
12    fn bind_endpoint(to: &Rocket<Ignite>) -> Result<Endpoint, Self::Error>;
13}