Trait snarkvm_console::prelude::FromFields
pub trait FromFields {
type Field: FieldTrait;
fn from_fields(fields: &[Self::Field]) -> Result<Self, Error>
where
Self: Sized;
}
Expand description
Unary operator for converting from a list of base elements.
Required Associated Types
type Field: FieldTrait
Required Methods
fn from_fields(fields: &[Self::Field]) -> Result<Self, Error>where
Self: Sized,
fn from_fields(fields: &[Self::Field]) -> Result<Self, Error>where
Self: Sized,
Initializes an object from a list of base field elements.
Implementations on Foreign Types
impl<E> FromFields for Address<E>where
E: Environment,
impl<E> FromFields for Address<E>where
E: Environment,
fn from_fields(
fields: &[<Address<E> as FromFields>::Field]
) -> Result<Address<E>, Error>
fn from_fields(
fields: &[<Address<E> as FromFields>::Field]
) -> Result<Address<E>, Error>
Initializes a new address by recovering the x-coordinate of an affine group from a field element.
type Field = Field<E>
impl<E> FromFields for Group<E>where
E: Environment,
impl<E> FromFields for Group<E>where
E: Environment,
fn from_fields(
fields: &[<Group<E> as FromFields>::Field]
) -> Result<Group<E>, Error>
fn from_fields(
fields: &[<Group<E> as FromFields>::Field]
) -> Result<Group<E>, Error>
Initializes a new group by recovering the x-coordinate of an affine group from a field element.
type Field = Field<E>
impl<E, I> FromFields for Integer<E, I>where
E: Environment,
I: IntegerType,
impl<E, I> FromFields for Integer<E, I>where
E: Environment,
I: IntegerType,
fn from_fields(
fields: &[<Integer<E, I> as FromFields>::Field]
) -> Result<Integer<E, I>, Error>
fn from_fields(
fields: &[<Integer<E, I> as FromFields>::Field]
) -> Result<Integer<E, I>, Error>
Initializes a new integer by recovering the x-coordinate of an affine group from a field element.
type Field = Field<E>
sourceimpl<N> FromFields for Ciphertext<N>where
N: Network,
impl<N> FromFields for Ciphertext<N>where
N: Network,
sourcefn from_fields(
fields: &[<Ciphertext<N> as FromFields>::Field]
) -> Result<Ciphertext<N>, Error>
fn from_fields(
fields: &[<Ciphertext<N> as FromFields>::Field]
) -> Result<Ciphertext<N>, Error>
Initializes a ciphertext from a list of base field elements.
type Field = Field<N>
sourceimpl<N> FromFields for Plaintext<N>where
N: Network,
impl<N> FromFields for Plaintext<N>where
N: Network,
sourcefn from_fields(
fields: &[<Plaintext<N> as FromFields>::Field]
) -> Result<Plaintext<N>, Error>
fn from_fields(
fields: &[<Plaintext<N> as FromFields>::Field]
) -> Result<Plaintext<N>, Error>
Initializes a plaintext from a list of base field elements.