Enum Plaintext
pub(crate) enum Plaintext<N>where
    N: Network,{
    Literal(Literal<N>, OnceLock<Vec<bool>>),
    Struct(IndexMap<Identifier<N>, Plaintext<N>>, OnceLock<Vec<bool>>),
    Array(Vec<Plaintext<N>>, OnceLock<Vec<bool>>),
}Variants§
Literal(Literal<N>, OnceLock<Vec<bool>>)
A literal.
Struct(IndexMap<Identifier<N>, Plaintext<N>>, OnceLock<Vec<bool>>)
A struct.
Array(Vec<Plaintext<N>>, OnceLock<Vec<bool>>)
An array.
Implementations§
§impl<N> Plaintext<N>where
    N: Network,
 
impl<N> Plaintext<N>where
    N: Network,
pub fn encrypt(
    &self,
    address: &Address<N>,
    randomizer: Scalar<N>,
) -> Result<Ciphertext<N>, Error>
pub fn encrypt( &self, address: &Address<N>, randomizer: Scalar<N>, ) -> Result<Ciphertext<N>, Error>
Encrypts self to the given address under the given randomizer.
pub fn encrypt_symmetric(
    &self,
    plaintext_view_key: Field<N>,
) -> Result<Ciphertext<N>, Error>
pub fn encrypt_symmetric( &self, plaintext_view_key: Field<N>, ) -> Result<Ciphertext<N>, Error>
Encrypts self under the given plaintext view key.
Trait Implementations§
§impl<'de, N> Deserialize<'de> for Plaintext<N>where
    N: Network,
 
impl<'de, N> Deserialize<'de> for Plaintext<N>where
    N: Network,
§fn deserialize<D>(
    deserializer: D,
) -> Result<Plaintext<N>, <D as Deserializer<'de>>::Error>where
    D: Deserializer<'de>,
 
fn deserialize<D>(
    deserializer: D,
) -> Result<Plaintext<N>, <D as Deserializer<'de>>::Error>where
    D: Deserializer<'de>,
Deserializes the plaintext from a string or bytes.
§impl<N> FromBytes for Plaintext<N>where
    N: Network,
 
impl<N> FromBytes for Plaintext<N>where
    N: Network,
§fn read_le<R>(reader: R) -> Result<Plaintext<N>, Error>where
    R: Read,
 
fn read_le<R>(reader: R) -> Result<Plaintext<N>, Error>where
    R: Read,
Reads the plaintext from a buffer.
§fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where
    Self: Sized,
 
fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where
    Self: Sized,
Returns 
Self from a byte array in little-endian order.§fn from_bytes_le_unchecked(bytes: &[u8]) -> Result<Self, Error>where
    Self: Sized,
 
fn from_bytes_le_unchecked(bytes: &[u8]) -> Result<Self, Error>where
    Self: Sized,
Same behavior as 
Self::from_bytes_le but avoids costly checks.
This shall only be called when deserializing from a trusted source, such as local storage. Read more§fn read_le_unchecked<R>(reader: R) -> Result<Self, Error>
 
fn read_le_unchecked<R>(reader: R) -> Result<Self, Error>
Same behavior as [
Self::read_le] but avoids costly checks.
This shall only be called when deserializing from a trusted source, such as local storage. Read more§impl<N> Serialize for Plaintext<N>where
    N: Network,
 
impl<N> Serialize for Plaintext<N>where
    N: Network,
§fn serialize<S>(
    &self,
    serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
    S: Serializer,
 
fn serialize<S>(
    &self,
    serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
    S: Serializer,
Serializes the plaintext into a string or as bytes.
§impl<N> ToBits for Plaintext<N>where
    N: Network,
 
impl<N> ToBits for Plaintext<N>where
    N: Network,
§fn write_bits_le(&self, vec: &mut Vec<bool>)
 
fn write_bits_le(&self, vec: &mut Vec<bool>)
Returns this plaintext as a list of little-endian bits.
§fn write_bits_be(&self, vec: &mut Vec<bool>)
 
fn write_bits_be(&self, vec: &mut Vec<bool>)
Returns this plaintext as a list of big-endian bits.
§fn to_bits_le(&self) -> Vec<bool>
 
fn to_bits_le(&self) -> Vec<bool>
Returns 
self as a boolean array in little-endian order.§fn to_bits_be(&self) -> Vec<bool>
 
fn to_bits_be(&self) -> Vec<bool>
Returns 
self as a boolean array in big-endian order.§impl<N> ToBitsRaw for Plaintext<N>where
    N: Network,
 
impl<N> ToBitsRaw for Plaintext<N>where
    N: Network,
§fn write_bits_raw_le(&self, vec: &mut Vec<bool>)
 
fn write_bits_raw_le(&self, vec: &mut Vec<bool>)
Returns this plaintext as a list of little-endian bits without variant or identifier bits.
§fn write_bits_raw_be(&self, vec: &mut Vec<bool>)
 
fn write_bits_raw_be(&self, vec: &mut Vec<bool>)
Returns this plaintext as a list of big-endian bits without variant or identifier bits.
§fn to_bits_raw_le(&self) -> Vec<bool>
 
fn to_bits_raw_le(&self) -> Vec<bool>
Returns 
self as a boolean array in little-endian order.§fn to_bits_raw_be(&self) -> Vec<bool>
 
fn to_bits_raw_be(&self) -> Vec<bool>
Returns 
self as a boolean array in big-endian order.impl<N> Eq for Plaintext<N>where
    N: Network,
Auto Trait Implementations§
impl<N> !Freeze for Plaintext<N>
impl<N> RefUnwindSafe for Plaintext<N>where
    <N as Environment>::Field: RefUnwindSafe,
    <N as Environment>::Projective: RefUnwindSafe,
    <N as Environment>::Scalar: RefUnwindSafe,
    N: RefUnwindSafe,
impl<N> Send for Plaintext<N>
impl<N> Sync for Plaintext<N>
impl<N> Unpin for Plaintext<N>
impl<N> UnwindSafe for Plaintext<N>where
    <N as Environment>::Field: UnwindSafe,
    <N as Environment>::Projective: UnwindSafe,
    <N as Environment>::Scalar: UnwindSafe,
    N: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
§impl<'de, T> DeserializeExt<'de> for Twhere
    T: DeserializeOwned,
 
impl<'de, T> DeserializeExt<'de> for Twhere
    T: DeserializeOwned,
fn take_from_value<D>(
    value: &mut Value,
    field: &str,
) -> Result<T, <D as Deserializer<'de>>::Error>where
    D: Deserializer<'de>,
§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to 
key and return true if they are equal.§impl<T> Instrument for T
 
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
 
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
    T: ?Sized,
 
impl<T> PolicyExt for Twhere
    T: ?Sized,
§impl<T> ToSmolStr for T
 
impl<T> ToSmolStr for T
fn to_smolstr(&self) -> SmolStr
§impl<T> ToStringFallible for Twhere
    T: Display,
 
impl<T> ToStringFallible for Twhere
    T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
 
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.