pub struct BuilderSdk { /* private fields */ }Expand description
Builder SDK for communicating with the EJ dispatcher.
Handles Unix socket communication and event processing between the builder and dispatcher.
Implementations§
Source§impl BuilderSdk
impl BuilderSdk
Sourcepub async fn init<F>(event_callback: F) -> Result<Self>
pub async fn init<F>(event_callback: F) -> Result<Self>
Initialize the builder SDK and start event processing.
Sets up Unix socket communication with the dispatcher and starts an async event loop to handle incoming events.
§Arguments
event_callback- Function called when events are received
§Examples
use ej_builder_sdk::{BuilderSdk, BuilderEvent};
let sdk = BuilderSdk::init(|event| {
match event {
BuilderEvent::Exit => std::process::exit(0),
}
}).await.unwrap();Sourcepub fn config_path(&self) -> PathBuf
pub fn config_path(&self) -> PathBuf
Get the path to the config.toml file.
Sourcepub fn board_name(&self) -> &str
pub fn board_name(&self) -> &str
Get the board name.
Sourcepub fn board_config_name(&self) -> &str
pub fn board_config_name(&self) -> &str
Get the board configuration name.
Auto Trait Implementations§
impl Freeze for BuilderSdk
impl RefUnwindSafe for BuilderSdk
impl Send for BuilderSdk
impl Sync for BuilderSdk
impl Unpin for BuilderSdk
impl UnwindSafe for BuilderSdk
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more