pub trait ServerSpec {
    fn address(&self) -> SocketAddr;

    fn builder(&self) -> Builder<AddrIncoming> { ... }
    fn serve<'life0, 'async_trait>(
        &'life0 self,
        client: Router
    ) -> Pin<Box<dyn Future<Output = AsyncResult> + Send + 'async_trait>>
    where
        Self: Sync + 'async_trait,
        'life0: 'async_trait
, { ... } }

Required Methods§

Fetch an instance of a std::net::SocketAddr

Provided Methods§

Creates a new builder instance with the address created from the given port

Examples found in repository?
src/servers/mod.rs (line 34)
32
33
34
35
36
37
38
39
        async fn serve(&self, client: axum::Router) -> AsyncResult {
            tracing::info!("Starting the server...");
            self.builder()
                .serve(client.into_make_service())
                .with_graceful_shutdown(crate::signals::shutdown::shutdown())
                .await?;
            Ok(())
        }

Implementors§