Trait std::ops::ShlStable
[-]
[+]
[src]
pub trait Shl<RHS> {
type Output;
fn shl(self, rhs: RHS) -> <Self as Shl<RHS>>::Output;
}The Shl trait is used to specify the functionality of <<.
Example
A trivial implementation of Shl. When Foo << Foo happens, it ends up
calling shl, and therefore, main prints Shifting left!.
#![feature(associated_types)] use std::ops::Shl; #[derive(Copy)] struct Foo; impl Shl<Foo> for Foo { type Output = Foo; fn shl(self, _rhs: Foo) -> Foo { println!("Shifting left!"); self } } fn main() { Foo << Foo; }