pub trait PlaintextConversionEngine<Input, Output>: AbstractEnginewhere
Input: PlaintextEntity,
Output: PlaintextEntity,{
fn convert_plaintext(
&mut self,
input: &Input
) -> Result<Output, PlaintextConversionError<Self::EngineError>>;
unsafe fn convert_plaintext_unchecked(&mut self, input: &Input) -> Output;
}
Expand description
A trait for engines converting plaintexts.
Semantics
This pure operation generates a plaintext containing the
conversion of the input
plaintext to a type with a different representation (for instance from
cpu to gpu memory).
Formal Definition
Required Methods
sourcefn convert_plaintext(
&mut self,
input: &Input
) -> Result<Output, PlaintextConversionError<Self::EngineError>>
fn convert_plaintext(
&mut self,
input: &Input
) -> Result<Output, PlaintextConversionError<Self::EngineError>>
Converts a plaintext.
sourceunsafe fn convert_plaintext_unchecked(&mut self, input: &Input) -> Output
unsafe fn convert_plaintext_unchecked(&mut self, input: &Input) -> Output
Unsafely converts a plaintext.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of PlaintextConversionError
. For safety concerns specific to an engine, refer to
the implementer safety section.