baml.ops.BitAnd

The bitwise AND operator, `self & rhs`.

Reference version

Signature

interface baml.ops.BitAnd<Rhs extends baml.Concrete>

The bitwise AND operator, self & rhs.

Rhs names the right-hand operand type and Output the result, the shape of Rust's ops::BitAnd. Only the integer primitives implement it in the standard library; a user type gains & by implementing this interface.

The integer impls treat operands as two's-complement bit patterns of unbounded width, so a negative operand behaves as if sign-extended forever: -1 & 5 is 5.

An implementation may panic, which throws never does not rule out; a caller working through a generic bound cannot enumerate the panics and must be ready for one it cannot describe. See baml.ops.Add.

Source:<builtin>/baml/ns_ops/bitwise.bamlbytes 2309–2635

Associated types

type Output

Required instance methods

function

bit_and

(self, rhs: Rhs) -> (Self as baml.ops.BitAnd<Rhs>).Output throws never

The bitwise AND of self and rhs.