Skip to main content

app

Attribute Macro app 

Source
#[app]
Expand description

Generates a main entry point for a RustStream service.

Place it on a synchronous, argument-free function that builds and returns an application - impl App (the recommended form, hiding the composed type parameters) or a concrete RustStream<_>. The expansion keeps the function and adds a main that hands it to ruststream::runtime::cli::run_main, producing a binary that understands the run and asyncapi gen commands with no hand-written runtime boilerplate.

#[ruststream::app]
fn app() -> impl App {
    RustStream::new(AppInfo::new("svc", "0.1.0")).register_broker(MemoryBroker::new())
}