Struct conrod::graph::Graph[][src]

pub struct Graph { /* fields omitted */ }

Stores the dynamic state of a UI tree of Widgets.

Methods

impl Graph
[src]

A new empty Graph.

A new Graph with the given node capacity.

We know that there can be no more than three parents per node as the public API enforces a maximum of one Depth, Position and Graphic parent each. Thus, we can assume an edge capacity of exactly three times the given node capacity.

Removes all Nodes and Edges from the Graph.

The total number of Nodes in the Graph.

The total number of Node::Widgets in the Graph.

The total number of Edges in the Graph.

The current capacity for the Graph's internal node Vec.

Add a new placeholder node and return it's widget::Id into the Graph.

This method is used by the widget::set_widget function when some internal widget does not yet have it's own widget::Id.

Borrow the node at the given widget::Id if there is one.

Mutably borrow the node at the given widget::Id if there is one.

Borrow the edge at the given EdgeIndex if there is one.

Mutably borrow the edge at the given EdgeIndex if there is one.

Return the parent and child nodes on either end of the Edge at the given index.

If there is a Widget for the given index, return a reference to it.

If there is a Widget for the given Id, return a mutable reference to it.

A Walker type that may be used to step through the parents of the given child node.

A Walker type that recursively walks the Graph using the given recursive_fn.

Panics If the given start index does not exist within the Graph.

If the widget at the given index has some parent along an Edge of the given variant, return an index to it.

Return the index of the parent along the given widget's Depth Edge.

Return the index of the parent along the given widget's Position Edge.

Return the index of the parent along the given widget's Position Edge.

Produces an iterator yielding the parents along both the X and Y Position Edges respectively.

Return the index of the parent along the given widget's Graphic Edge.

A Walker type that recursively walks Depth parents starting from the given node.

A Walker type that recursively walks X Position parents starting from the given node.

A Walker type that recursively walks Y Position parents starting from the given node.

A Walker type that recursively walks Graphic parents starting from the given node.

A Walker type that recursively walks Depth parents that are scrollable along the y axis for the given node.

A Walker type that recursively walks Depth parents that are scrollable along the x axis for the given node.

A Walker type that may be used to step through the children of the given parent node.

For walking the Depth children of the given parent node.

For walking the Position(X) children of the given parent node.

For walking the Position(Y) children of the given parent node.

For walking the Position children of the given parent node.

This first walks the Axis::X children, before walking the Axis::Y children.

For walking the Graphic children of the given parent node.

Does the given edge type exist between the nodes parent -> child.

Returns false if either of the given node indices do not exist.

Does a Edge::Depth exist between the nodes parent -> child.

Returns false if either of the given node indices do not exist.

Does a Edge::Position exist between the nodes parent -> child.

Returns false if either of the given node indices do not exist.

Does a Edge::Graphic exist between the nodes parent -> child.

Returns false if either of the given node indices do not exist.

Are the given parent and child nodes connected by a single chain of edges of the given kind?

i.e. parent -> x -> y -> child.

Returns false if either of the given node indices do not exist.

Are the given parent and child nodes connected by a single chain of Depth edges?

i.e. parent -> x -> y -> child.

Returns false if either of the given node indices do not exist.

Are the given parent and child nodes connected by a single chain of Graphic edges?

i.e. parent -> x -> y -> child.

Returns false if either of the given node indices do not exist.

Cache some PreUpdateCache widget data into the graph.

This is called (via the ui module) from within the widget::set_widget function prior to the Widget::update method being called.

This is done so that if this Widget were to internally set some other Widgets within its own update method, this Widgets positioning and dimension data already exists within the Graph for reference.

Cache some PostUpdateCache widget data into the graph.

This is called (via the ui module) from within the widget::set_widget function after the Widget::update method is called and some new state is returned.

Trait Implementations

impl Debug for Graph
[src]

Formats the value using the given formatter. Read more

impl Walker<Graph> for Children
[src]

The unsigned integer type used for node and edge indices.

Fetch the EdgeIndex and NodeIndex to the next neighbour in our walk through the given Graph. Read more

The next edge in our walk for the given Graph.

The next node in our walk for the given Graph.

Counts all the steps in the entire walk of the given graph.

Walks the whole walk until reaching and returning the last edge node pair.

Walks the whole walk until reaching and returning the last edge.

Walks the whole walk until reaching and returning the last node.

Walks "n" number of steps and produces the resulting edge node pair.

Walks "n" number of steps and produces the resulting edge.

Walks "n" number of steps and produces the resulting node.

Produces a walker that will walk the entirey of self before walking the entirey of other.

Creates a walker that applies the predicate to each element returned by this walker. The only elements that will be yielded are those that make the predicate evaluate to true. Read more

Creates a walker that has a .peek(&graph) method that returns an optional next neighbor.

Creates a walker that invokes the predicate on elements until it returns false. Once the predicate returns false, that element and all further elements are yielded. Read more

Creates a walker that yields elements so long as the predicate returns true. After the predicate returns false for the first time, no further elements will be yielded. Read more

Creates a walker that skips the first n steps of this walk, and then yields all further steps. Read more

Creates a walker that yields the first n steps of this walk.

Tests whether the predicate holds true for all steps in the walk.

Tests whether any step in the walk satisfies the given predicate. Read more

Returns the first edge node index pair satisfying the specified predicate. Read more

Returns the edge index satisfying the specified predicate. Read more

Returns the node index satisfying the specified predicate. Read more

Repeats the walker endlessly.

Performs a fold operation over the entire walker, returning the eventual state at the end of the walk. Read more

Creates a walker that calls a function with a reference to each index pair before yielding them. This is often useful for debugging a walker pipeline. Read more

Important traits for Iter<'a, G, Ix, W>

Converts the walker into an iterator yielding index pairs. Read more

Important traits for IterWeights<'a, G, Ix, W>

Converts the walker into an iterator yielding (&e, &n), where e is the edge weight for the next EdgeIndex and n is the node weight for the next NodeIndex. Read more

impl Walker<Graph> for Parents
[src]

The unsigned integer type used for node and edge indices.

Fetch the EdgeIndex and NodeIndex to the next neighbour in our walk through the given Graph. Read more

The next edge in our walk for the given Graph.

The next node in our walk for the given Graph.

Counts all the steps in the entire walk of the given graph.

Walks the whole walk until reaching and returning the last edge node pair.

Walks the whole walk until reaching and returning the last edge.

Walks the whole walk until reaching and returning the last node.

Walks "n" number of steps and produces the resulting edge node pair.

Walks "n" number of steps and produces the resulting edge.

Walks "n" number of steps and produces the resulting node.

Produces a walker that will walk the entirey of self before walking the entirey of other.

Creates a walker that applies the predicate to each element returned by this walker. The only elements that will be yielded are those that make the predicate evaluate to true. Read more

Creates a walker that has a .peek(&graph) method that returns an optional next neighbor.

Creates a walker that invokes the predicate on elements until it returns false. Once the predicate returns false, that element and all further elements are yielded. Read more

Creates a walker that yields elements so long as the predicate returns true. After the predicate returns false for the first time, no further elements will be yielded. Read more

Creates a walker that skips the first n steps of this walk, and then yields all further steps. Read more

Creates a walker that yields the first n steps of this walk.

Tests whether the predicate holds true for all steps in the walk.

Tests whether any step in the walk satisfies the given predicate. Read more

Returns the first edge node index pair satisfying the specified predicate. Read more

Returns the edge index satisfying the specified predicate. Read more

Returns the node index satisfying the specified predicate. Read more

Repeats the walker endlessly.

Performs a fold operation over the entire walker, returning the eventual state at the end of the walk. Read more

Creates a walker that calls a function with a reference to each index pair before yielding them. This is often useful for debugging a walker pipeline. Read more

Important traits for Iter<'a, G, Ix, W>

Converts the walker into an iterator yielding index pairs. Read more

Important traits for IterWeights<'a, G, Ix, W>

Converts the walker into an iterator yielding (&e, &n), where e is the edge weight for the next EdgeIndex and n is the node weight for the next NodeIndex. Read more

impl Index<Id> for Graph
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl IndexMut<Id> for Graph
[src]

Performs the mutable indexing (container[index]) operation.

impl Index<EdgeIndex> for Graph
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl IndexMut<EdgeIndex> for Graph
[src]

Performs the mutable indexing (container[index]) operation.

Auto Trait Implementations

impl Send for Graph

impl !Sync for Graph