Skip to main content

bind

Macro bind 

Source
macro_rules! bind {
    ($handler:expr) => { ... };
}
Expand description

Convenience macro to bind a handler to an endpoint without turbofish.

Instead of bind::<_, _, _>(handler), write bind!(handler). The endpoint type is inferred from the Serves<API> context.

Server::<API>::new((
    bind!(hello),
    bind!(get_user),
    bind!(create_user),
));