Trait conrod::graph::GraphIndex
[−]
[src]
pub trait GraphIndex: Debug + Copy + Clone { fn to_widget_id(self, map: &IndexMap) -> Option<WidgetId>; fn to_node_index(self, map: &IndexMap) -> Option<NodeIndex>; fn from_idx<I: GraphIndex>(other: I, map: &IndexMap) -> Option<Self>; }
A trait for being generic over both WidgetId and NodeIndex.
Each method should only return Some
if they are contained as a key within the given IndexMap.
Required Methods
fn to_widget_id(self, map: &IndexMap) -> Option<WidgetId>
If not one already, convert Self to a WidgetId if it exists within the IndexMap.
fn to_node_index(self, map: &IndexMap) -> Option<NodeIndex>
If not one already, convert Self to a NodeIndex if it exists within the IndexMap.
fn from_idx<I: GraphIndex>(other: I, map: &IndexMap) -> Option<Self>
Convert some GraphIndex type to Self.