Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Corelib
&
pub trait BitAnd
BitAnd
bool
use core::traits::BitAnd; #[derive(Drop, PartialEq)] struct Scalar { inner: bool, } impl BitAndScalar of BitAnd { fn bitand(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: false }); assert!(Scalar { inner: false } & Scalar { inner: true } == Scalar { inner: false }); assert!(Scalar { inner: false } & Scalar { inner: false } == Scalar { inner: false });
fn bitand(lhs: T, rhs: T) -> T
assert_eq!(true & false, false); assert_eq!(5_u8 & 1_u8, 1); assert_eq!(true & true, true); assert_eq!(5_u8 & 2_u8, 0);
Was this page helpful?