pub struct GraphId(pub Uuid);Expand description
Stable identifier for a graph document.
Tuple Fields§
§0: UuidImplementations§
Source§impl GraphId
impl GraphId
Sourcepub fn from_u128(value: u128) -> Self
pub fn from_u128(value: u128) -> Self
Creates a graph id from a stable 128-bit value.
Examples found in repository?
examples/build_graph.rs (line 34)
32fn main() {
33 let node_id = NodeId::from_u128(2);
34 let mut graph = Graph::new(GraphId::from_u128(1));
35
36 let mut tx = GraphTransaction::new().with_label("add source node");
37 tx.push(GraphOp::AddNode {
38 id: node_id,
39 node: make_node("demo.source", 10.0, 20.0),
40 });
41 tx.apply_to(&mut graph).expect("transaction applies");
42
43 assert_eq!(graph.nodes.len(), 1);
44 assert_eq!(graph.nodes[&node_id].kind, NodeKindKey::new("demo.source"));
45}Sourcepub fn from_bytes(bytes: [u8; 16]) -> Self
pub fn from_bytes(bytes: [u8; 16]) -> Self
Creates a graph id from raw UUID bytes.
Trait Implementations§
impl Copy for GraphId
Source§impl<'de> Deserialize<'de> for GraphId
impl<'de> Deserialize<'de> for GraphId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for GraphId
Source§impl Ord for GraphId
impl Ord for GraphId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for GraphId
impl PartialOrd for GraphId
impl StructuralPartialEq for GraphId
Auto Trait Implementations§
impl Freeze for GraphId
impl RefUnwindSafe for GraphId
impl Send for GraphId
impl Sync for GraphId
impl Unpin for GraphId
impl UnsafeUnpin for GraphId
impl UnwindSafe for GraphId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more