pub struct EmberClient { /* private fields */ }Expand description
An Ember+ client for connecting to providers.
Implementations§
Source§impl EmberClient
impl EmberClient
Sourcepub async fn connect_with_config(
address: &str,
config: ClientConfig,
) -> Result<Self>
pub async fn connect_with_config( address: &str, config: ClientConfig, ) -> Result<Self>
Connect with custom configuration.
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if connected.
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnect from the provider.
Sourcepub async fn get_directory(&self) -> Result<GlowRoot>
pub async fn get_directory(&self) -> Result<GlowRoot>
Get the root directory.
Sourcepub async fn send_request(&self, request: GlowRoot) -> Result<GlowRoot>
pub async fn send_request(&self, request: GlowRoot) -> Result<GlowRoot>
Send a raw Glow request and get response.
Sourcepub async fn get_element_by_path(
&self,
path: &str,
) -> Result<Option<TreeNodeRef>>
pub async fn get_element_by_path( &self, path: &str, ) -> Result<Option<TreeNodeRef>>
Get an element by path (numeric path like “0.1.2”). This navigates progressively through the tree, requesting children at each level.
Sourcepub async fn expand(&self, path: &str) -> Result<()>
pub async fn expand(&self, path: &str) -> Result<()>
Expand the tree under a node (get all children recursively).
Sourcepub async fn expand_root(&self) -> Result<()>
pub async fn expand_root(&self) -> Result<()>
Expand starting from root.
Sourcepub async fn set_value(&self, path: &str, value: EmberValue) -> Result<()>
pub async fn set_value(&self, path: &str, value: EmberValue) -> Result<()>
Set a parameter value.
Sourcepub async fn unsubscribe(&self, path: &str) -> Result<()>
pub async fn unsubscribe(&self, path: &str) -> Result<()>
Unsubscribe from changes at a path.
Sourcepub async fn invoke(
&self,
path: &str,
arguments: Vec<EmberValue>,
) -> Result<InvocationResult>
pub async fn invoke( &self, path: &str, arguments: Vec<EmberValue>, ) -> Result<InvocationResult>
Invoke a function.
Sourcepub async fn tree(&self) -> RwLockReadGuard<'_, EmberTree>
pub async fn tree(&self) -> RwLockReadGuard<'_, EmberTree>
Get the local tree cache.
Sourcepub async fn on_value_change(
&self,
callback: Box<dyn Fn(&EmberPath, &EmberValue) + Send + Sync>,
)
pub async fn on_value_change( &self, callback: Box<dyn Fn(&EmberPath, &EmberValue) + Send + Sync>, )
Register a callback for value updates.
Sourcepub async fn on_stream_update(
&self,
callback: Box<dyn Fn(i32, &EmberValue) + Send + Sync>,
)
pub async fn on_stream_update( &self, callback: Box<dyn Fn(i32, &EmberValue) + Send + Sync>, )
Register a callback for stream updates.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EmberClient
impl !RefUnwindSafe for EmberClient
impl Send for EmberClient
impl Sync for EmberClient
impl Unpin for EmberClient
impl UnsafeUnpin for EmberClient
impl !UnwindSafe for EmberClient
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