Trait std::ops::BitOrStable
[-]
[+]
[src]
pub trait BitOr<RHS = Self> {
type Output;
fn bitor(self, rhs: RHS) -> <Self as BitOr<RHS>>::Output;
}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!.
#![feature(associated_types)] use std::ops::BitOr; #[derive(Copy)] struct Foo; impl BitOr for Foo { type Output = Foo; fn bitor(self, _rhs: Foo) -> Foo { println!("Bitwise Or-ing!"); self } } fn main() { Foo | Foo; }
Required Methods
Implementors
impl BitOr<bool> for boolimpl BitOr<usize> for usizeimpl BitOr<u8> for u8impl BitOr<u16> for u16impl BitOr<u32> for u32impl BitOr<u64> for u64impl BitOr<isize> for isizeimpl BitOr<i8> for i8impl BitOr<i16> for i16impl BitOr<i32> for i32impl BitOr<i64> for i64impl BitOr for FilePermissionimpl<'a, 'b, T, S, H> BitOr<&'b HashSet<T, S>> for &'a HashSet<T, S> where T: Eq + Hash<H> + Clone, S: HashState<Hasher=H> + Default, H: Hasher<Output=u64>impl<'a, 'b, T, S, H> BitOr<&'b HashSet<T, S>> for &'a HashSet<T, S> where T: Eq + Hash<H> + Clone, S: HashState<Hasher=H> + Default, H: Hasher<Output=u64>impl<'a, 'b, T: Ord + Clone> BitOr<&'b BTreeSet<T>> for &'a BTreeSet<T>impl<E: CLike> BitOr<EnumSet<E>> for EnumSet<E>