pub trait CleartextCreationEngine<Value, Cleartext>: AbstractEnginewhere
Cleartext: CleartextEntity,{
fn create_cleartext_from(
&mut self,
value: &Value
) -> Result<Cleartext, CleartextCreationError<Self::EngineError>>;
unsafe fn create_cleartext_from_unchecked(
&mut self,
value: &Value
) -> Cleartext;
}
Expand description
A trait for engines creating cleartexts from arbitrary values.
Semantics
This pure operation generates a cleartext from the value
arbitrary value. 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
sourcefn create_cleartext_from(
&mut self,
value: &Value
) -> Result<Cleartext, CleartextCreationError<Self::EngineError>>
fn create_cleartext_from(
&mut self,
value: &Value
) -> Result<Cleartext, CleartextCreationError<Self::EngineError>>
Creates a cleartext from an arbitrary value.
sourceunsafe fn create_cleartext_from_unchecked(&mut self, value: &Value) -> Cleartext
unsafe fn create_cleartext_from_unchecked(&mut self, value: &Value) -> Cleartext
Unsafely creates a cleartext from an arbitrary value.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of CleartextCreationError
. For safety concerns specific to an
engine, refer to the implementer safety section.
Implementors
impl CleartextCreationEngine<f64, CleartextF64> for DefaultEngine
Description:
Implementation of CleartextCreationEngine
for DefaultEngine
that operates on 64 bits
floating point numbers.
impl CleartextCreationEngine<u32, Cleartext32> for DefaultEngine
Description:
Implementation of CleartextCreationEngine
for DefaultEngine
that operates on 32 bits
integers.
impl CleartextCreationEngine<u64, Cleartext64> for DefaultEngine
Description:
Implementation of CleartextCreationEngine
for DefaultEngine
that operates on 64 bits
integers.