45 lines
1.5 KiB
Rust
45 lines
1.5 KiB
Rust
use super::*;
|
|
|
|
impl SpacetimeClient {
|
|
pub async fn confirm_asset_object(
|
|
&self,
|
|
input: module_assets::AssetObjectUpsertInput,
|
|
) -> Result<AssetObjectRecord, SpacetimeClientError> {
|
|
let procedure_input = map_upsert_input(input);
|
|
|
|
self.call_after_connect(move |connection, sender| {
|
|
connection
|
|
.procedures()
|
|
.confirm_asset_object_and_return_then(procedure_input, move |_, result| {
|
|
let mapped = result
|
|
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
|
.and_then(map_procedure_result);
|
|
send_once(&sender, mapped);
|
|
});
|
|
})
|
|
.await
|
|
}
|
|
|
|
|
|
pub async fn bind_asset_object_to_entity(
|
|
&self,
|
|
input: module_assets::AssetEntityBindingInput,
|
|
) -> Result<AssetEntityBindingRecord, SpacetimeClientError> {
|
|
let procedure_input = map_entity_binding_input(input);
|
|
|
|
self.call_after_connect(move |connection, sender| {
|
|
connection
|
|
.procedures()
|
|
.bind_asset_object_to_entity_and_return_then(procedure_input, move |_, result| {
|
|
let mapped = result
|
|
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
|
.and_then(map_entity_binding_procedure_result);
|
|
send_once(&sender, mapped);
|
|
});
|
|
})
|
|
.await
|
|
}
|
|
|
|
|
|
}
|