snarkvm_console_program

Trait Cast

Source
pub trait Cast<T: Sized = Self> {
    // Required method
    fn cast(&self) -> Result<T>;
}
Expand description

Unary operator for casting values of one type to another.

Required Methods§

Source

fn cast(&self) -> Result<T>

Casts the value of self into a value of type T.

This method checks that the cast does not lose any bits of information, and returns an error if it does.

Implementors§

Source§

impl<E: Environment> Cast for Boolean<E>

Source§

impl<E: Environment> Cast for Field<E>

Source§

impl<E: Environment> Cast for Scalar<E>

Source§

impl<E: Environment> Cast<Boolean<E>> for Field<E>

Source§

impl<E: Environment> Cast<Boolean<E>> for Scalar<E>

Source§

impl<E: Environment> Cast<Field<E>> for Boolean<E>

Source§

impl<E: Environment> Cast<Field<E>> for Scalar<E>

Source§

impl<E: Environment> Cast<Address<E>> for Boolean<E>

Source§

impl<E: Environment> Cast<Address<E>> for Field<E>

Source§

impl<E: Environment> Cast<Address<E>> for Scalar<E>

Source§

impl<E: Environment> Cast<Group<E>> for Boolean<E>

Source§

impl<E: Environment> Cast<Group<E>> for Field<E>

Source§

impl<E: Environment> Cast<Group<E>> for Scalar<E>

Source§

impl<E: Environment> Cast<Scalar<E>> for Boolean<E>

Source§

impl<E: Environment> Cast<Scalar<E>> for Field<E>

Source§

impl<E: Environment, I0: IntegerType, I1: IntegerType + TryFrom<I0>> Cast<Integer<E, I1>> for Integer<E, I0>

Source§

impl<E: Environment, I: IntegerType> Cast<Boolean<E>> for Integer<E, I>

Source§

impl<E: Environment, I: IntegerType> Cast<Field<E>> for Integer<E, I>

Source§

impl<E: Environment, I: IntegerType> Cast<Integer<E, I>> for Boolean<E>

Source§

impl<E: Environment, I: IntegerType> Cast<Integer<E, I>> for Field<E>

Source§

impl<E: Environment, I: IntegerType> Cast<Integer<E, I>> for Scalar<E>

Source§

impl<E: Environment, I: IntegerType> Cast<Address<E>> for Integer<E, I>

Source§

impl<E: Environment, I: IntegerType> Cast<Group<E>> for Integer<E, I>

Source§

impl<E: Environment, I: IntegerType> Cast<Scalar<E>> for Integer<E, I>