Skip to main content

EntityGraph

Struct EntityGraph 

Source
pub struct EntityGraph<Node>
where Node: EntityRef,
{ /* private fields */ }
Expand description

A graph of EntityRef nodes reified into a densely packed representation.

Implementations§

Source§

impl<Node> EntityGraph<Node>
where Node: EntityRef + Debug,

Source

pub fn new<E>( nodes: impl IntoIterator<Item = Node>, successors: impl FnMut(Node, &mut Vec<Node>) -> Result<(), E>, ) -> Result<Self, E>

Construct a new, concrete EntityGraph.

Trait Implementations§

Source§

impl<Node> Debug for EntityGraph<Node>
where Node: EntityRef + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Node> Graph<Node> for EntityGraph<Node>
where Node: EntityRef,

Source§

type NodesIter<'a> = Keys<Node> where Self: 'a

The iterator type returned by Nodes::nodes.
Source§

type SuccessorsIter<'a> = Copied<Iter<'a, Node>> where Self: 'a

The iterator type returned by Successors::successors.
Source§

fn nodes(&self) -> Self::NodesIter<'_>

Iterate over the nodes in this graph.
Source§

fn successors(&self, node: Node) -> Self::SuccessorsIter<'_>

Iterate over the successors of the given node.
Source§

fn by_ref(&self) -> &Self

Like Iterator::by_ref but for Graph.
Source§

fn filter_nodes<F>(self, predicate: F) -> FilterNodes<Self, F>
where Self: Sized, F: Fn(&Node) -> bool,

Use the given predicate to filter out certain nodes from the graph.

Auto Trait Implementations§

§

impl<Node> Freeze for EntityGraph<Node>

§

impl<Node> RefUnwindSafe for EntityGraph<Node>
where Node: RefUnwindSafe,

§

impl<Node> Send for EntityGraph<Node>
where Node: Send,

§

impl<Node> Sync for EntityGraph<Node>
where Node: Sync,

§

impl<Node> Unpin for EntityGraph<Node>
where Node: Unpin,

§

impl<Node> UnwindSafe for EntityGraph<Node>
where Node: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.