pub struct UpdateEngine<'a> {
pub trapdoor: TrapdoorEngine<'a>,
}Fields§
§trapdoor: TrapdoorEngine<'a>Implementations§
Source§impl<'a> UpdateEngine<'a>
impl<'a> UpdateEngine<'a>
pub fn new(keys: &'a MasterKeySet) -> Self
Sourcepub fn prepare_add(
&self,
keyword: &[u8],
doc_id: Uuid,
state: &mut KeywordState,
) -> Result<RawEdbEntry, VaultError>
pub fn prepare_add( &self, keyword: &[u8], doc_id: Uuid, state: &mut KeywordState, ) -> Result<RawEdbEntry, VaultError>
Prepare one EDB entry to index doc_id under keyword.
Mutates state (increments counters, records the new index).
Returns the RawEdbEntry to be sent to the server.
The caller must persist the updated state before (or atomically with)
sending the entry to the server. If the state is lost after the server
write, use TrapdoorEngine::generate_recovery_probe to reconstruct it.
Sourcepub fn prepare_delete(
&self,
keyword: &[u8],
doc_id: Uuid,
state: &mut KeywordState,
) -> Result<DeleteBatch, VaultError>
pub fn prepare_delete( &self, keyword: &[u8], doc_id: Uuid, state: &mut KeywordState, ) -> Result<DeleteBatch, VaultError>
Remove doc_id from keyword’s result set.
Returns a batch of EDB entries to: (a) DELETE the old epoch’s entries (server removes them by tag). (b) PUT new epoch’s entries for all surviving docs.
The batch must be applied atomically on the server side. If an entry was not indexed under this keyword, returns an empty Vec.
Auto Trait Implementations§
impl<'a> Freeze for UpdateEngine<'a>
impl<'a> RefUnwindSafe for UpdateEngine<'a>
impl<'a> Send for UpdateEngine<'a>
impl<'a> Sync for UpdateEngine<'a>
impl<'a> Unpin for UpdateEngine<'a>
impl<'a> UnsafeUnpin for UpdateEngine<'a>
impl<'a> UnwindSafe for UpdateEngine<'a>
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