Crate trillium_tokio

Source
Expand description

§Trillium server adapter for tokio

fn main() {
    trillium_tokio::run(|conn: trillium::Conn| async move {
        conn.ok("hello tokio")
    });
}
#[tokio::main]
async fn main() {
    trillium_tokio::run_async(|conn: trillium::Conn| async move {
        conn.ok("hello tokio")
    }).await;
}

Re-exports§

pub use async_compat;
pub use tokio;
pub use tokio_stream;

Structs§

ClientConfig
configuration for the tcp Connector
CloneCounterObserver
An observer that can be cloned without modifying the clone counter, but can be used to inspect its state and awaited
Stopper
This struct provides a synchronized mechanism for canceling Futures and Streams.
TokioTransport
A transport newtype for tokio

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§

block_on
reexport tokio runtime block_on
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
spawn
spawn and detach a Future that returns ()