Skip to main content

Crate ej_builder_sdk

Crate ej_builder_sdk 

Source
Expand description

Builder SDK for the EJ framework.

Provides communication interface between builders and the EJ dispatcher.

§Usage

use ej_builder_sdk::{BuilderSdk, BuilderEvent};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let sdk = BuilderSdk::init(|sdk, event| async move {
        match event {
            BuilderEvent::Exit => {
                // Cleanup logic here
                println!("Received exit signal for: ");
                println!("{} {} ({:?})", sdk.board_name(), sdk.board_config_name(), sdk.action());
                std::process::exit(0);
            }
        }
    }).await.unwrap();
     
    // Builder logic here
    Ok(())
}

Modules§

error
Error types for the builder SDK.
prelude
Crate Prelude

Structs§

BuilderSdk
Builder SDK for communicating with the EJ dispatcher.

Enums§

Action
BuilderEvent
Events sent from the dispatcher to the builder.
BuilderResponse
Responses sent from the builder to the dispatcher.