pub struct AimxClient { /* private fields */ }Expand description
AimX protocol client
Implementations§
Source§impl AimxClient
impl AimxClient
Sourcepub async fn connect(socket_path: impl AsRef<Path>) -> ClientResult<Self>
pub async fn connect(socket_path: impl AsRef<Path>) -> ClientResult<Self>
Connect to an AimDB instance
Sourcepub fn server_info(&self) -> &WelcomeMessage
pub fn server_info(&self) -> &WelcomeMessage
Get server information
Sourcepub async fn list_records(&mut self) -> ClientResult<Vec<RecordMetadata>>
pub async fn list_records(&mut self) -> ClientResult<Vec<RecordMetadata>>
List all registered records
Sourcepub async fn reset_stage_profiling(&mut self) -> ClientResult<Value>
pub async fn reset_stage_profiling(&mut self) -> ClientResult<Value>
Reset stage profiling counters for every record on the server.
Requires the server to be built with the profiling feature and the
connection to have write permission.
Sourcepub async fn reset_buffer_metrics(&mut self) -> ClientResult<Value>
pub async fn reset_buffer_metrics(&mut self) -> ClientResult<Value>
Reset buffer introspection counters for every record on the server.
Requires the server to be built with the metrics feature and the
connection to have write permission.
Sourcepub async fn get_record(&mut self, name: &str) -> ClientResult<Value>
pub async fn get_record(&mut self, name: &str) -> ClientResult<Value>
Get current value of a record
Sourcepub async fn set_record(
&mut self,
name: &str,
value: Value,
) -> ClientResult<Value>
pub async fn set_record( &mut self, name: &str, value: Value, ) -> ClientResult<Value>
Set value of a writable record
Sourcepub async fn subscribe(
&mut self,
name: &str,
queue_size: usize,
) -> ClientResult<String>
pub async fn subscribe( &mut self, name: &str, queue_size: usize, ) -> ClientResult<String>
Subscribe to record updates
Sourcepub async fn unsubscribe(&mut self, subscription_id: &str) -> ClientResult<()>
pub async fn unsubscribe(&mut self, subscription_id: &str) -> ClientResult<()>
Unsubscribe from record updates
Sourcepub async fn receive_event(&mut self) -> ClientResult<Event>
pub async fn receive_event(&mut self) -> ClientResult<Event>
Receive next event from subscription
Sourcepub async fn drain_record(&mut self, name: &str) -> ClientResult<DrainResponse>
pub async fn drain_record(&mut self, name: &str) -> ClientResult<DrainResponse>
Drain all pending values from a record’s drain reader.
Returns all values accumulated since the last drain call, in chronological order. This is a destructive read — drained values will not be returned again.
The first call for a given record creates the drain reader and returns empty (cold start). Subsequent calls return accumulated values.
Sourcepub async fn drain_record_with_limit(
&mut self,
name: &str,
limit: u32,
) -> ClientResult<DrainResponse>
pub async fn drain_record_with_limit( &mut self, name: &str, limit: u32, ) -> ClientResult<DrainResponse>
Drain with a limit on the number of values returned.
Sourcepub async fn graph_nodes(&mut self) -> ClientResult<Vec<Value>>
pub async fn graph_nodes(&mut self) -> ClientResult<Vec<Value>>
Get all nodes in the dependency graph.
Returns a list of GraphNode objects representing all records and their connections in the database.
Sourcepub async fn graph_edges(&mut self) -> ClientResult<Vec<Value>>
pub async fn graph_edges(&mut self) -> ClientResult<Vec<Value>>
Get all edges in the dependency graph.
Returns a list of GraphEdge objects representing data flow connections between records.
Sourcepub async fn graph_topo_order(&mut self) -> ClientResult<Vec<String>>
pub async fn graph_topo_order(&mut self) -> ClientResult<Vec<String>>
Get the topological ordering of records.
Returns the record keys in topological order, ensuring all dependencies are listed before dependents. Useful for understanding data flow and initialization order.