pub trait ToField {
    type Field: FieldTrait;

    // Required method
    fn to_field(&self) -> Result<Self::Field, Error>;
}
Expand description

Unary operator for converting to a base field.

Required Associated Types§

Required Methods§

fn to_field(&self) -> Result<Self::Field, Error>

Returns the object as a base field element.

Implementations on Foreign Types§

§

impl<E> ToField for Address<E>where E: Environment,

§

fn to_field(&self) -> Result<<Address<E> as ToField>::Field, Error>

Returns the address as a field element.

§

type Field = Field<E>

§

impl<E> ToField for Group<E>where E: Environment,

§

fn to_field(&self) -> Result<<Group<E> as ToField>::Field, Error>

Returns the group as a field element.

§

type Field = Field<E>

§

impl<E> ToField for Scalar<E>where E: Environment,

§

fn to_field(&self) -> Result<<Scalar<E> as ToField>::Field, Error>

Returns the scalar as a field element.

§

type Field = Field<E>

§

impl<E, I> ToField for Integer<E, I>where E: Environment, I: IntegerType,

§

fn to_field(&self) -> Result<<Integer<E, I> as ToField>::Field, Error>

Converts an integer into a field element.

§

type Field = Field<E>

source§

impl<N> ToField for &Identifier<N>where N: Network,

source§

fn to_field(&self) -> Result<<&Identifier<N> as ToField>::Field, Error>

Returns the identifier as a field element.

§

type Field = Field<N>

source§

impl<N> ToField for Identifier<N>where N: Network,

source§

fn to_field(&self) -> Result<<Identifier<N> as ToField>::Field, Error>

Returns the identifier as a field element.

§

type Field = Field<N>

Implementors§