Skip to content

Instantly share code, notes, and snippets.

@ebfull
Created December 23, 2015 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebfull/2b9da9a0d9bacf801931 to your computer and use it in GitHub Desktop.
Save ebfull/2b9da9a0d9bacf801931 to your computer and use it in GitHub Desktop.
use std::rc::Rc;
trait Art<T, A: Adapton> {}
struct Location;
impl<T, A: Adapton> Art<T, A> for Location { }
trait Adapton {
fn put<T>(obj: T) -> Rc<Art<T, Self>>;
}
struct Engine;
impl Adapton for Engine {
fn put<T>(obj: T) -> Rc<Art<T, Engine>> {
Rc::new(Location)
}
}
fn main() { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment