Skip to main content

UpdateEngine

Struct UpdateEngine 

Source
pub struct UpdateEngine<'a> {
    pub trapdoor: TrapdoorEngine<'a>,
}

Fields§

§trapdoor: TrapdoorEngine<'a>

Implementations§

Source§

impl<'a> UpdateEngine<'a>

Source

pub fn new(keys: &'a MasterKeySet) -> Self

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V