Skip to main content

node_id_of

Function node_id_of 

Source
pub fn node_id_of<T>(rc: &Rc<RefCell<T>>) -> NodeId
Expand description

Extract a NodeId from an Rc<RefCell<T>> using pointer identity.

ยงExamples

use reify_graph::{node_id_of, NodeId};
use std::cell::RefCell;
use std::rc::Rc;

let a = Rc::new(RefCell::new(42));
let b = a.clone();
assert_eq!(node_id_of(&a), node_id_of(&b));