cairo_vm::with_std::ops

Trait Not

1.0.0 · Source
pub trait Not {
    type Output;

    // Required method
    fn not(self) -> Self::Output;
}
Expand description

The unary logical negation operator !.

§Examples

An implementation of Not for Answer, which enables the use of ! to invert its value.

use std::ops::Not;

#[derive(Debug, PartialEq)]
enum Answer {
    Yes,
    No,
}

impl Not for Answer {
    type Output = Self;

    fn not(self) -> Self::Output {
        match self {
            Answer::Yes => Answer::No,
            Answer::No => Answer::Yes
        }
    }
}

assert_eq!(!Answer::Yes, Answer::No);
assert_eq!(!Answer::No, Answer::Yes);

Required Associated Types§

1.0.0 · Source

type Output

The resulting type after applying the ! operator.

Required Methods§

1.0.0 · Source

fn not(self) -> Self::Output

Performs the unary ! operation.

§Examples
assert_eq!(!true, false);
assert_eq!(!false, true);
assert_eq!(!1u8, 254);
assert_eq!(!0u8, 255);

Implementors§

1.0.0 · Source§

impl Not for &bool

1.0.0 · Source§

impl Not for &i8

1.0.0 · Source§

impl Not for &i16

1.0.0 · Source§

impl Not for &i32

1.0.0 · Source§

impl Not for &i64

1.0.0 · Source§

impl Not for &i128

1.0.0 · Source§

impl Not for &isize

1.0.0 · Source§

impl Not for &u8

1.0.0 · Source§

impl Not for &u16

1.0.0 · Source§

impl Not for &u32

1.0.0 · Source§

impl Not for &u64

1.0.0 · Source§

impl Not for &u128

1.0.0 · Source§

impl Not for &usize

1.74.0 · Source§

impl Not for &Saturating<i8>

1.74.0 · Source§

impl Not for &Saturating<i16>

1.74.0 · Source§

impl Not for &Saturating<i32>

1.74.0 · Source§

impl Not for &Saturating<i64>

1.74.0 · Source§

impl Not for &Saturating<i128>

1.74.0 · Source§

impl Not for &Saturating<isize>

1.74.0 · Source§

impl Not for &Saturating<u8>

1.74.0 · Source§

impl Not for &Saturating<u16>

1.74.0 · Source§

impl Not for &Saturating<u32>

1.74.0 · Source§

impl Not for &Saturating<u64>

1.74.0 · Source§

impl Not for &Saturating<u128>

1.74.0 · Source§

impl Not for &Saturating<usize>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<i8>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<i16>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<i32>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<i64>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<i128>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<isize>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<u8>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<u16>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<u32>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<u64>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<u128>

1.14.0 · Source§

impl Not for &cairo_vm::with_std::num::Wrapping<usize>

1.75.0 · Source§

impl Not for &Ipv4Addr

1.75.0 · Source§

impl Not for &Ipv6Addr

Source§

impl Not for &BigInt

1.0.0 · Source§

impl Not for bool

1.0.0 · Source§

impl Not for i8

1.0.0 · Source§

impl Not for i16

1.0.0 · Source§

impl Not for i32

1.0.0 · Source§

impl Not for i64

1.0.0 · Source§

impl Not for i128

1.0.0 · Source§

impl Not for isize

1.60.0 · Source§

impl Not for !

1.0.0 · Source§

impl Not for u8

1.0.0 · Source§

impl Not for u16

1.0.0 · Source§

impl Not for u32

1.0.0 · Source§

impl Not for u64

1.0.0 · Source§

impl Not for u128

1.0.0 · Source§

impl Not for usize

1.74.0 · Source§

impl Not for Saturating<i8>

1.74.0 · Source§

impl Not for Saturating<i16>

1.74.0 · Source§

impl Not for Saturating<i32>

1.74.0 · Source§

impl Not for Saturating<i64>

1.74.0 · Source§

impl Not for Saturating<i128>

1.74.0 · Source§

impl Not for Saturating<isize>

1.74.0 · Source§

impl Not for Saturating<u8>

1.74.0 · Source§

impl Not for Saturating<u16>

1.74.0 · Source§

impl Not for Saturating<u32>

1.74.0 · Source§

impl Not for Saturating<u64>

1.74.0 · Source§

impl Not for Saturating<u128>

1.74.0 · Source§

impl Not for Saturating<usize>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<i8>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<i16>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<i32>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<i64>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<i128>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<isize>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<u8>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<u16>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<u32>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<u64>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<u128>

1.0.0 · Source§

impl Not for cairo_vm::with_std::num::Wrapping<usize>

1.75.0 · Source§

impl Not for Ipv4Addr

1.75.0 · Source§

impl Not for Ipv6Addr

Source§

impl Not for Limb

Source§

impl Not for BigInt

Source§

impl Not for udouble

Source§

impl Not for u32x4_generic

Source§

impl Not for u64x2_generic

Source§

impl Not for u128x1_generic

Source§

impl Not for Choice

Source§

impl Not for B0

Not of 0 (!0 = 1)

Source§

impl Not for B1

Not of 1 (!1 = 0)

Source§

impl<'a, T, O> Not for &'a mut BitSlice<T, O>
where T: BitStore, O: BitOrder,

Inverts each bit in the bit-slice.

Unlike the &, |, and ^ operators, this implementation is guaranteed to update each memory element only once, and is not required to traverse every live bit in the underlying region.

Source§

type Output = &'a mut BitSlice<T, O>

Source§

impl<A, O> Not for BitArray<A, O>
where A: BitViewSized, O: BitOrder,

Source§

impl<M, T, O> Not for BitRef<'_, M, T, O>
where M: Mutability, T: BitStore, O: BitOrder,

Source§

impl<O> Not for I16<O>

Source§

impl<O> Not for I32<O>

Source§

impl<O> Not for I64<O>

Source§

impl<O> Not for I128<O>

Source§

impl<O> Not for U16<O>

Source§

impl<O> Not for U32<O>

Source§

impl<O> Not for U64<O>

Source§

impl<O> Not for U128<O>

Source§

impl<R> Not for BitMask<R>
where R: BitRegister,

Source§

impl<T, O> Not for BitBox<T, O>
where T: BitStore, O: BitOrder,

Source§

type Output = BitBox<T, O>

Source§

impl<T, O> Not for BitVec<T, O>
where T: BitStore, O: BitOrder,

This implementation inverts all elements in the live buffer. You cannot rely on the value of bits in the buffer that are outside the domain of BitVec::as_mut_bitslice.

Source§

type Output = BitVec<T, O>

Source§

impl<T, const N: usize> Not for Mask<T, N>

Source§

type Output = Mask<T, N>

Source§

impl<const LIMBS: usize> Not for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

Source§

impl<const LIMBS: usize> Not for crypto_bigint::wrapping::Wrapping<Uint<LIMBS>>

Source§

impl<const N: usize> Not for Simd<i8, N>

Source§

impl<const N: usize> Not for Simd<i16, N>

Source§

impl<const N: usize> Not for Simd<i32, N>

Source§

impl<const N: usize> Not for Simd<i64, N>

Source§

impl<const N: usize> Not for Simd<isize, N>

Source§

impl<const N: usize> Not for Simd<u8, N>

Source§

impl<const N: usize> Not for Simd<u16, N>

Source§

impl<const N: usize> Not for Simd<u32, N>

Source§

impl<const N: usize> Not for Simd<u64, N>

Source§

impl<const N: usize> Not for Simd<usize, N>