Trait core::ops::BitAndExperimental
[-]
[+]
[src]
pub trait BitAnd<RHS, Result> { fn bitand(self, rhs: RHS) -> Result; }
The BitAnd
trait is used to specify the functionality of &
.
Example
A trivial implementation of BitAnd
. When Foo & Foo
happens, it ends up
calling bitand
, and therefore, main
prints Bitwise And-ing!
.
#[deriving(Copy)] struct Foo; impl BitAnd<Foo, Foo> for Foo { fn bitand(self, _rhs: Foo) -> Foo { println!("Bitwise And-ing!"); self } } fn main() { Foo & Foo; }
Required Methods
fn bitand(self, rhs: RHS) -> Result
The method for the &
operator
Implementors
impl BitAnd<bool, bool> for bool
impl BitAnd<uint, uint> for uint
impl BitAnd<u8, u8> for u8
impl BitAnd<u16, u16> for u16
impl BitAnd<u32, u32> for u32
impl BitAnd<u64, u64> for u64
impl BitAnd<int, int> for int
impl BitAnd<i8, i8> for i8
impl BitAnd<i16, i16> for i16
impl BitAnd<i32, i32> for i32
impl BitAnd<i64, i64> for i64