pub trait CleartextEncodingEngine<Encoder, Cleartext, Plaintext>: AbstractEnginewhere
Encoder: EncoderEntity,
Cleartext: CleartextEntity,
Plaintext: PlaintextEntity,{
fn encode_cleartext(
&mut self,
encoder: &Encoder,
cleartext: &Cleartext
) -> Result<Plaintext, CleartextEncodingError<Self::EngineError>>;
unsafe fn encode_cleartext_unchecked(
&mut self,
encoder: &Encoder,
cleartext: &Cleartext
) -> Plaintext;
}
Expand description
A trait for engines encoding cleartexts.
Semantics
This pure operation generates a plaintext containing the encoding
of the cleartext
cleartext, under the encoder
encoder.
Formal Definition
Required Methods
sourcefn encode_cleartext(
&mut self,
encoder: &Encoder,
cleartext: &Cleartext
) -> Result<Plaintext, CleartextEncodingError<Self::EngineError>>
fn encode_cleartext(
&mut self,
encoder: &Encoder,
cleartext: &Cleartext
) -> Result<Plaintext, CleartextEncodingError<Self::EngineError>>
Encodes a cleartext into a plaintext.
sourceunsafe fn encode_cleartext_unchecked(
&mut self,
encoder: &Encoder,
cleartext: &Cleartext
) -> Plaintext
unsafe fn encode_cleartext_unchecked(
&mut self,
encoder: &Encoder,
cleartext: &Cleartext
) -> Plaintext
Unsafely encodes a cleartext into a plaintext.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of CleartextEncodingError
. For safety concerns specific to an
engine, refer to the implementer safety section.
Implementors
impl CleartextEncodingEngine<FloatEncoder, CleartextF64, Plaintext32> for DefaultEngine
Description:
Implementation of CleartextEncodingEngine
for DefaultEngine
that encodes 64 bits
floating point numbers to 32 bits integers.
impl CleartextEncodingEngine<FloatEncoder, CleartextF64, Plaintext64> for DefaultEngine
Description:
Implementation of CleartextEncodingEngine
for DefaultEngine
that encodes 64 bits
floating point numbers to 32 bits integers.