Skip to main content

Cast

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

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<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<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<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<IdentifierLiteral<E>> for Boolean<E>

Source§

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

Source§

impl<E: Environment> Cast<IdentifierLiteral<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<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<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<Group<E>> for Integer<E, I>

Source§

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

Source§

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

Source§

impl<N: Network> Cast for IdentifierLiteral<N>

Source§

impl<N: Network> Cast<Address<N>> for IdentifierLiteral<N>

Source§

impl<N: Network> Cast<Boolean<N>> for IdentifierLiteral<N>

Source§

impl<N: Network> Cast<Field<N>> for IdentifierLiteral<N>

Source§

impl<N: Network> Cast<Group<N>> for IdentifierLiteral<N>

Source§

impl<N: Network> Cast<Scalar<N>> for IdentifierLiteral<N>

Source§

impl<N: Network, I: IntegerType> Cast<Integer<N, I>> for IdentifierLiteral<N>