1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use super::*;
impl Entry {
pub fn new(id: Id, element: Element) -> Entry {
Entry { id, element }
}
}
impl From<Vertex> for Element {
fn from(vertex: Vertex) -> Element {
Element::Vertex(vertex)
}
}
impl From<Edge> for Element {
fn from(edge: Edge) -> Element {
Element::Edge(edge)
}
}
macro_rules! impl_from_for_element {
($type:ident::$name:ident) => {
impl From<$name> for Element {
fn from(s: $name) -> Element {
Element::$type($type::$name(s))
}
}
};
}
impl_from_for_element!(Vertex::Project);
impl_from_for_element!(Vertex::Document);
impl_from_for_element!(Vertex::Range);
impl_from_for_element!(Vertex::Event);
impl_from_for_element!(Vertex::Moniker);
impl_from_for_element!(Vertex::PackageInformation);
impl_from_for_element!(Vertex::MetaData);
impl_from_for_element!(Edge::Item);