Struct arithmetic_typing::arith::BoolArithmetic
source · pub struct BoolArithmetic;
Expand description
Simplest TypeArithmetic
implementation that defines unary / binary ops only on
the Boolean type. Useful as a building block for more complex arithmetics.
Trait Implementations§
source§impl Clone for BoolArithmetic
impl Clone for BoolArithmetic
source§fn clone(&self) -> BoolArithmetic
fn clone(&self) -> BoolArithmetic
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BoolArithmetic
impl Debug for BoolArithmetic
source§impl Default for BoolArithmetic
impl Default for BoolArithmetic
source§fn default() -> BoolArithmetic
fn default() -> BoolArithmetic
Returns the “default value” for a type. Read more
source§impl<Prim: WithBoolean> TypeArithmetic<Prim> for BoolArithmetic
impl<Prim: WithBoolean> TypeArithmetic<Prim> for BoolArithmetic
source§fn process_unary_op(
&self,
substitutions: &mut Substitutions<Prim>,
context: &UnaryOpContext<Prim>,
errors: OpErrors<'_, Prim>
) -> Type<Prim>
fn process_unary_op( &self, substitutions: &mut Substitutions<Prim>, context: &UnaryOpContext<Prim>, errors: OpErrors<'_, Prim> ) -> Type<Prim>
Processes a unary operation.
!
requires a Boolean input and outputs a Boolean.- Other operations fail with
ErrorKind::UnsupportedFeature
.
source§fn process_binary_op(
&self,
substitutions: &mut Substitutions<Prim>,
context: &BinaryOpContext<Prim>,
errors: OpErrors<'_, Prim>
) -> Type<Prim>
fn process_binary_op( &self, substitutions: &mut Substitutions<Prim>, context: &BinaryOpContext<Prim>, errors: OpErrors<'_, Prim> ) -> Type<Prim>
Processes a binary operation.
==
and!=
require LHS and RHS to have the same type (no matter which one). These ops returnBool
.&&
and||
require LHS and RHS to haveBool
type. These ops returnBool
.- Other operations fail with
ErrorKind::UnsupportedFeature
.
impl Copy for BoolArithmetic
Auto Trait Implementations§
impl RefUnwindSafe for BoolArithmetic
impl Send for BoolArithmetic
impl Sync for BoolArithmetic
impl Unpin for BoolArithmetic
impl UnwindSafe for BoolArithmetic
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more