Struct glycos::graph::cryptograph::EdgeBuilder [−][src]
Expand description
Builder for Edges.
The process of creating an Edge is a bit more involved than for Vertices,
although the interface is very alike.
- Select the
fromandtoedges. - Add the mandatory
label;
Before adding from, to, and label, the build method will not be available at compile time.
Examples
use glycos::crypto::ec::*;
use glycos::graph::cryptograph::*;
let rng = ring::rand::SystemRandom::new();
let alice = PrivateKey::generate(&rng).expect("Generate key");
let public = alice.compute_public_key().unwrap();
let (v, k) = VertexBuilder::new(&rng, &public).unwrap()
.build(&rng, &alice).unwrap();
let (v2, _k) = VertexBuilder::new(&rng, &public).unwrap()
.value("foaf:Person").unwrap()
.build(&rng, &alice).unwrap();
let e = EdgeBuilder::default()
.from(&v)
.to(&v2)
.label("a")
.build(&rng, &k).unwrap();Fields
from: Fring_builder: Vec<&'r PublicKey>to: Tlabel: LImplementations
Sets \(V_a\) in the Edge \(V_a \rightarrow V_b\).
Sets \(V_b\) in the Edge \(V_a \rightarrow V_b\).
Sets the mandatory edge label in the labeled graph.
Build the actual Edge.
The secret key should come from VertexBuilder::build() or equivalently from
Vertex::check_acl().
