Created
July 26, 2017 14:06
-
-
Save anonymous/39acc531e26e79d9888a67e4135ba1f7 to your computer and use it in GitHub Desktop.
Rust code shared from the playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
trait Graph { | |
type Node; | |
type Edge; | |
} | |
struct GraphImpl<N, E> { | |
h: HashMap<N, Vec<E>>, | |
} | |
type MyNode = i32; | |
type MyEdge = i32; | |
type MyGraph = GraphImpl<MyNode, MyEdge>; | |
impl<N, E> Graph for GraphImpl<N, E> { | |
type Node = N; | |
type Edge = E; | |
} | |
fn main() { | |
let x: <MyGraph as Graph>::Node; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment