Skip to content

Instantly share code, notes, and snippets.

Created May 14, 2016
What would you like to do?
trait Behaviour {
fn run(&self);
struct YoujoBehaviour{}
impl Behaviour for YoujoBehaviour{
fn run(&self){println!("はわわ");}
struct Caller<'a> {
behaviour: Box<Behaviour+'a>,
impl<'a> Caller<'a> {
fn run(&self) {;
fn main(){
let c = Caller{behaviour: Box::new(YoujoBehaviour{})};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment