Trait tfhe::prelude::FheTryEncrypt
source · pub trait FheTryEncrypt<T, Key>where
Self: Sized,{
type Error: Error;
// Required method
fn try_encrypt(value: T, key: &Key) -> Result<Self, Self::Error>;
}
Available on crate feature
integer
only.Expand description
Trait used to have a generic fallible way of creating a value of a FHE type.
For example this trait may be implemented by FHE types which may not be able to represent all the values of even the smallest native type.
For example, FheUint2
which has 2 bits of precision may not be constructed from
all values that a u8
can hold.
Required Associated Types§
Required Methods§
fn try_encrypt(value: T, key: &Key) -> Result<Self, Self::Error>
Object Safety§
This trait is not object safe.