hyperlane

Attribute Macro hyperlane 

Source
#[hyperlane]
Expand description

Creates a new instance of a specified type with a given variable name.

This attribute macro generates an instance initialization at the beginning of the function.

ยงUsage

use hyperlane::*;
use hyperlane_macros::*;

#[hyperlane(server: Server)]
#[hyperlane(config: ServerConfig)]
#[tokio::main]
async fn main() {
    config.disable_nodelay().await;
    server.config(config).await;
    let server_hook: ServerControlHook = server.run().await.unwrap_or_default();
    server_hook.wait().await;
}

The macro accepts a variable_name: Type pair. The variable will be available as an instance of the specified type in the function scope.