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, Fut>(event_callback: F) -> Result<Self>
pub async fn init<F, Fut>(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(|sdk, event| async move {
println!("{:?} {} {} ({:?})", event, sdk.board_name(), sdk.board_config_name(), sdk.action());
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.
Trait Implementations§
Source§impl Clone for BuilderSdk
impl Clone for BuilderSdk
Source§fn clone(&self) -> BuilderSdk
fn clone(&self) -> BuilderSdk
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BuilderSdk
impl RefUnwindSafe for BuilderSdk
impl Send for BuilderSdk
impl Sync for BuilderSdk
impl Unpin for BuilderSdk
impl UnsafeUnpin 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