field_ios

In-the-field app for Radroots on iOS
git clone https://radroots.dev/git/field_ios.git
Log | Files | Refs | README | LICENSE

key_removal.rs (732B)


      1 use crate::{
      2     FfiDraftStatusRecord, FfiRuntimeChangeKind, TeraAppError, TeraRuntime, dto::decode_id,
      3 };
      4 
      5 #[cfg_attr(not(coverage_nightly), uniffi::export(async_runtime = "tokio"))]
      6 impl TeraRuntime {
      7     pub async fn prepare_retraction_for_key_removal(
      8         &self,
      9         draft_id: String,
     10         expected_revision: u64,
     11     ) -> Result<FfiDraftStatusRecord, TeraAppError> {
     12         let id = decode_id(&draft_id, "invalid_draft_id")?;
     13         let result = self
     14             .inner
     15             .prepare_retraction_for_key_removal(id, expected_revision)
     16             .await;
     17         self.subscriptions
     18             .notify(FfiRuntimeChangeKind::Drafts, Some(draft_id));
     19         result.map(Into::into).map_err(Into::into)
     20     }
     21 }