pub struct NodeId(pub Uuid);Expand description
Stable identifier for a node instance.
Tuple Fields§
§0: UuidImplementations§
Source§impl NodeId
impl NodeId
Sourcepub fn from_u128(value: u128) -> Self
pub fn from_u128(value: u128) -> Self
Creates a node id from a stable 128-bit value.
Examples found in repository?
examples/build_graph.rs (line 33)
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}Trait Implementations§
impl Copy for NodeId
Source§impl<'de> Deserialize<'de> for NodeId
impl<'de> Deserialize<'de> for NodeId
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 NodeId
Source§impl Ord for NodeId
impl Ord for NodeId
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 NodeId
impl PartialOrd for NodeId
impl StructuralPartialEq for NodeId
Auto Trait Implementations§
impl Freeze for NodeId
impl RefUnwindSafe for NodeId
impl Send for NodeId
impl Sync for NodeId
impl Unpin for NodeId
impl UnsafeUnpin for NodeId
impl UnwindSafe for NodeId
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