pub struct NodeMap<T: Copy + Ord + Debug + Serialize> {
node_to_id: BTreeMap<T, NodeId>,
id_to_node: Vec<T>,
}
Expand description
A bidirectional mapping between fast_paths NodeId and some custom ID type.
Fields§
§node_to_id: BTreeMap<T, NodeId>
§id_to_node: Vec<T>
Implementations§
source§impl<T: Copy + Ord + Debug + Serialize> NodeMap<T>
impl<T: Copy + Ord + Debug + Serialize> NodeMap<T>
pub fn new() -> NodeMap<T>
pub fn get_or_insert(&mut self, node: T) -> NodeId
pub fn get(&self, node: T) -> NodeId
pub fn translate_id(&self, id: usize) -> T
sourcepub fn guarantee_node_ordering(&self, input_graph: &mut InputGraph)
pub fn guarantee_node_ordering(&self, input_graph: &mut InputGraph)
Call this after filling out the input graph, right before preparation.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for NodeMap<T>
impl<T> RefUnwindSafe for NodeMap<T>where
T: RefUnwindSafe,
impl<T> Send for NodeMap<T>where
T: Send,
impl<T> Sync for NodeMap<T>where
T: Sync,
impl<T> Unpin for NodeMap<T>where
T: Unpin,
impl<T> UnwindSafe for NodeMap<T>where
T: RefUnwindSafe + UnwindSafe,
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