Struct cl_interpret::builtin::or
source · pub struct or;
Expand description
Bitwise Or a | b
ⓘ
builtin! fn or (lhs, rhs) -> IResult<ConValue>
{
Ok(match (lhs, rhs) {
(ConValue::Empty, ConValue::Empty) => ConValue::Empty,
(ConValue::Int(a), ConValue::Int(b)) => ConValue::Int(a | b),
(ConValue::Bool(a), ConValue::Bool(b)) => ConValue::Bool(a | b),
_ => Err(Error::TypeError)?,
})
}
Trait Implementations§
source§impl Callable for or
impl Callable for or
source§fn call(&self, env: &mut Environment, args: &[ConValue]) -> IResult<ConValue>
fn call(&self, env: &mut Environment, args: &[ConValue]) -> IResult<ConValue>
Calls this Callable in the provided Environment, with ConValue args
The Callable is responsible for checking the argument count and validating types
The Callable is responsible for checking the argument count and validating types
Auto Trait Implementations§
impl Freeze for or
impl RefUnwindSafe for or
impl Send for or
impl Sync for or
impl Unpin for or
impl UnwindSafe for or
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