28 lines
953 B
Rust
28 lines
953 B
Rust
use super::*;
|
|
|
|
impl SpacetimeClient {
|
|
pub async fn get_runtime_inventory_state(
|
|
&self,
|
|
runtime_session_id: String,
|
|
actor_user_id: String,
|
|
) -> Result<RuntimeInventoryStateRecord, SpacetimeClientError> {
|
|
let procedure_input =
|
|
build_runtime_inventory_state_query_input(runtime_session_id, actor_user_id)
|
|
.map_err(SpacetimeClientError::validation_failed)?
|
|
.into();
|
|
|
|
self.call_after_connect(move |connection, sender| {
|
|
connection.procedures().get_runtime_inventory_state_then(
|
|
procedure_input,
|
|
move |_, result| {
|
|
let mapped = result
|
|
.map_err(SpacetimeClientError::from_sdk_error)
|
|
.and_then(map_runtime_inventory_state_procedure_result);
|
|
send_once(&sender, mapped);
|
|
},
|
|
);
|
|
})
|
|
.await
|
|
}
|
|
}
|