Enum conrod::WidgetIndex [] [src]

pub enum WidgetIndex {
    Public(WidgetId),
    Internal(NodeIndex),
}

An index either given in the form of a publicly instantiated Widget's WidgetId, or an internally instantiated Widget's NodeIndex,

Variants

Public(WidgetId)

A public identifier given by a user of a conrod library/widget, usually generated by the widget_ids macro.

Internal(NodeIndex)

An index to an internal widget, usually used to construct some other widget.

Trait Implementations

impl GraphIndex for Index
[src]

fn to_node_index(self, map: &IndexMap) -> Option<NodeIndex>

Coerce a widget::Index into an Option. If the Index is the Internal variant, that idx will be used directly. If the Index is the Public variant, the index_map will be used to find the matching NodeIndex.

fn to_widget_id(self, map: &IndexMap) -> Option<WidgetId>

Coerce a widget::Index into an Option. If the Index is the Public variant, that id will be used directly. If the Index is the Internal variant, the index_map will be used to find the matching WidgetId.

fn from_idx<I: GraphIndex>(other: I, map: &IndexMap) -> Option<Self>

Construct a widget::Index from some GraphIndex. First tries to construct a Public variant by checking the IndexMap for a matching WidgetId. If not WidgetId is found, then tries to find a matching NodeIndex.

impl Ord for Index
[src]

fn cmp(&self, __arg_0: &Index) -> Ordering

This method returns an Ordering between self and other. Read more

impl PartialOrd for Index
[src]

fn partial_cmp(&self, __arg_0: &Index) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, __arg_0: &Index) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, __arg_0: &Index) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, __arg_0: &Index) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, __arg_0: &Index) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Eq for Index
[src]

impl PartialEq for Index
[src]

fn eq(&self, __arg_0: &Index) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Index) -> bool

This method tests for !=.

impl Debug for Index
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for Index
[src]

fn clone(&self) -> Index

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for Index
[src]

impl From<WidgetId> for Index
[src]

fn from(id: WidgetId) -> Index

Performs the conversion.

impl From<NodeIndex> for Index
[src]

fn from(idx: NodeIndex) -> Index

Performs the conversion.