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