Trait snarkvm_console::prelude::from_field::FromFields
pub trait FromFields {
type Field: FieldTrait;
// Required method
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>
source§impl<N> FromFields for Plaintext<N>where
N: Network,
impl<N> FromFields for Plaintext<N>where N: Network,
source§impl<N> FromFields for Ciphertext<N>where
N: Network,
impl<N> FromFields for Ciphertext<N>where N: Network,
source§fn 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.