Trait core::ops::BitOr[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!.
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 boolimpl BitOr<uint, uint> for uintimpl BitOr<u8, u8> for u8impl BitOr<u16, u16> for u16impl BitOr<u32, u32> for u32impl BitOr<u64, u64> for u64impl BitOr<int, int> for intimpl BitOr<i8, i8> for i8impl BitOr<i16, i16> for i16impl BitOr<i32, i32> for i32impl BitOr<i64, i64> for i64