Skip to main content

CastLossy

Trait CastLossy 

Source
pub trait CastLossy<T: Sized = 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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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