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)]
#[tokio::main]
async fn main() {
    // `server` is now available as: `let server: Server = Server::new().await;`
    // The function body can now use `server`.
}

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