Skip to main content

SearchProtocol

Struct SearchProtocol 

Source
pub struct SearchProtocol<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> SearchProtocol<'a>

Source

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

Generate a single-use search token for keyword.

Returns Ok(None) if the keyword has no live results (never written or all documents deleted), so the caller can skip the network round-trip.

Source

pub async fn fetch_token_results<S: EncryptedStore>( &self, token: &SearchToken, store: &S, ) -> Result<Vec<Option<EncValue>>, VaultError>

Convenience: fetch all tagged entries for a token from an EDB in one call.

Decrypt and verify the server’s response.

Each enc_values[i] corresponds to token.pairs[i]. Entries that the server reports as missing are silently skipped (the server may have lost them; this is the “robustness” the paper addresses). Entries that fail GCM verification return VaultError::Tampered.

Source

pub async fn search<S: EncryptedStore>( &self, keyword: &str, store: &S, ) -> Result<Vec<SearchResult>, VaultError>

Full search: prepare token → fetch from store → decrypt results.

Equivalent to calling prepare_search + fetch_token_results + finalize_search in sequence. Useful for single-threaded environments.

Auto Trait Implementations§

§

impl<'a> Freeze for SearchProtocol<'a>

§

impl<'a> RefUnwindSafe for SearchProtocol<'a>

§

impl<'a> Send for SearchProtocol<'a>

§

impl<'a> Sync for SearchProtocol<'a>

§

impl<'a> Unpin for SearchProtocol<'a>

§

impl<'a> UnsafeUnpin for SearchProtocol<'a>

§

impl<'a> UnwindSafe for SearchProtocol<'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