Skip to main content

bind

Function bind 

Source
pub fn bind<E, H, Args>(handler: H) -> BoundHandler<E>
where E: BindableEndpoint, H: Handler<Args>, Args: 'static,
Expand description

Bind a handler to an endpoint type, erasing the handler’s arg types.

This is where type inference resolves the handler’s Args parameter. After binding, only the endpoint type E remains.

§Example

use typeway_server::bind;

let h = bind::<GetEndpoint<path!("hello"), String>, _, _>(hello_handler);