Skip to main content

Crate trillium_async_std

Crate trillium_async_std 

Source
Expand description

§Trillium server adapter for async-std

fn main() {
    trillium_async_std::run(|conn: trillium::Conn| async move { conn.ok("hello async-std") });
}
#[async_std::main]
async fn main() {
    trillium_async_std::run_async(
        |conn: trillium::Conn| async move { conn.ok("hello async-std") },
    )
    .await;
}

Re-exports§

pub use async_std;

Structs§

AsyncStdRuntime
async-std runtime
AsyncStdTransport
A transport newtype for async-std
AsyncStdUdpSocket
Async-io-backed UDP socket for use with QUIC transports.
ClientConfig
configuration for the tcp Connector
Swansong
🦢 Shutdown manager

Enums§

Binding
A wrapper enum that has blanket implementations for common traits like TryFrom, Stream, AsyncRead, and AsyncWrite. This can contain listeners (like TcpListener), Streams (like Incoming), or bytestreams (like TcpStream).

Functions§

config
Configures a server before running it
run
Runs a trillium handler in a sync context with default config
run_async
Runs a trillium handler in an async context with default config