Trait CastLossy

Source
pub trait CastLossy<T = Self> {
    // Required method
    fn cast_lossy(&self) -> T;
}
Expand description

Unary operator for casting values of one type to another, with lossy truncation.

Required Methods§

Source

fn cast_lossy(&self) -> T

Casts the value of self into a value of type T, with lossy truncation.

This method makes a best-effort attempt to preserve all bits of information, but it is not guaranteed to do so.

Implementors§

Source§

impl<E> CastLossy for Boolean<E>
where E: Environment,

Source§

impl<E> CastLossy for Field<E>
where E: Environment,

Source§

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

Source§

impl<E> CastLossy<Address<E>> for Boolean<E>
where E: Environment,

Source§

impl<E> CastLossy<Address<E>> for Field<E>
where E: Environment,

Source§

impl<E> CastLossy<Address<E>> for Scalar<E>
where E: Environment,

Source§

impl<E> CastLossy<Boolean<E>> for Field<E>
where E: Environment,

Source§

impl<E> CastLossy<Boolean<E>> for Scalar<E>
where E: Environment,

Source§

impl<E> CastLossy<Field<E>> for Boolean<E>
where E: Environment,

Source§

impl<E> CastLossy<Field<E>> for Scalar<E>
where E: Environment,

Source§

impl<E> CastLossy<Group<E>> for Boolean<E>
where E: Environment,

Source§

impl<E> CastLossy<Group<E>> for Field<E>
where E: Environment,

Source§

impl<E> CastLossy<Group<E>> for Scalar<E>
where E: Environment,

Source§

impl<E> CastLossy<Scalar<E>> for Boolean<E>
where E: Environment,

Source§

impl<E> CastLossy<Scalar<E>> for Field<E>
where E: Environment,

Source§

impl<E, I0, I1> CastLossy<Integer<E, I1>> for Integer<E, I0>
where E: Environment, I0: IntegerType, I1: IntegerType,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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