pub trait PlaintextRetrievalEngine<Plaintext, Value>: AbstractEngine where
Plaintext: PlaintextEntity, {
fn retrieve_plaintext(
&mut self,
plaintext: &Plaintext
) -> Result<Value, PlaintextRetrievalError<Self::EngineError>>;
unsafe fn retrieve_plaintext_unchecked(
&mut self,
plaintext: &Plaintext
) -> Value;
}
Expand description
A trait for engines retrieving arbitrary values from plaintexts.
Semantics
This pure operation generates an arbitrary value from the
plaintext
plaintext. By arbitrary here, we mean that Value
can be any type that suits the
backend implementor (an integer, a struct wrapping integers, a struct wrapping foreign data or
any other thing).
Formal Definition
Required Methods
fn retrieve_plaintext(
&mut self,
plaintext: &Plaintext
) -> Result<Value, PlaintextRetrievalError<Self::EngineError>>
fn retrieve_plaintext(
&mut self,
plaintext: &Plaintext
) -> Result<Value, PlaintextRetrievalError<Self::EngineError>>
Retrieves an arbitrary value from a plaintext.
unsafe fn retrieve_plaintext_unchecked(&mut self, plaintext: &Plaintext) -> Value
unsafe fn retrieve_plaintext_unchecked(&mut self, plaintext: &Plaintext) -> Value
Unsafely retrieves an arbitrary value from a plaintext.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of PlaintextRetrievalError
. For safety concerns specific to an engine, refer to the
implementer safety section.
Implementors
impl PlaintextRetrievalEngine<Plaintext32, u32> for DefaultEngine
Description:
Implementation of PlaintextRetrievalEngine
for DefaultEngine
that operates on 64 bits
integers.
impl PlaintextRetrievalEngine<Plaintext64, u64> for DefaultEngine
Description:
Implementation of PlaintextRetrievalEngine
for DefaultEngine
that operates on 64 bits
integers.