Struct glycos::graph::cryptograph::EdgeBuilder[][src]

pub struct EdgeBuilder<'r, F, T, L> {
    from: F,
    ring_builder: Vec<&'r PublicKey>,
    to: T,
    label: L,
}
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.

  1. Select the from and to edges.
  2. 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: L

Implementations

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().

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.