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