Documentation Index
Fetch the complete documentation index at: https://docs.starknet.io/llms.txt
Use this file to discover all available pages before exploring further.
The bitwise OR operator |.
Signature
Examples
An implementation of BitOr for a wrapper around bool.
use core::traits::BitOr;
#[derive(Drop, PartialEq)]
struct Scalar {
inner: bool,
}
impl BitOrScalar of BitOr {
fn bitor(lhs: Scalar, rhs: Scalar) -> Scalar {
Scalar { inner: lhs.inner | rhs.inner }
}
}
assert!(Scalar { inner: true } | Scalar { inner: true } == Scalar { inner: true });
assert!(Scalar { inner: true } | Scalar { inner: false } == Scalar { inner: true });
assert!(Scalar { inner: false } | Scalar { inner: true } == Scalar { inner: true });
assert!(Scalar { inner: false } | Scalar { inner: false } == Scalar { inner: false });
Trait functions
bitor
Performs the | operation.
Signature
fn bitor(lhs: T, rhs: T) -> T
Examples
assert!(1_u8 | 2_u8 == 3);