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
sourceimpl<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> 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: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more