Trait LogicalOps

Source
pub trait LogicalOps {
    // Required methods
    fn not(&self) -> Result<Self, String>
       where Self: Sized;
    fn and(&self, other: &Self) -> Result<Self, String>
       where Self: Sized;
    fn or(&self, other: &Self) -> Result<Self, String>
       where Self: Sized;
}
Expand description

Logical operations on values

Required Methods§

Source

fn not(&self) -> Result<Self, String>
where Self: Sized,

Performs logical NOT on a boolean value.

§Returns
  • The negated boolean value
  • An error message if the type is incompatible
Source

fn and(&self, other: &Self) -> Result<Self, String>
where Self: Sized,

Performs logical AND between two boolean values.

§Arguments
  • other - The other value
§Returns
  • The result of the AND operation
  • An error message if either value is not a boolean
Source

fn or(&self, other: &Self) -> Result<Self, String>
where Self: Sized,

Performs logical OR between two boolean values.

§Arguments
  • other - The other value
§Returns
  • The result of the OR operation
  • An error message if either value is not a boolean

Implementors§