Skip to main content

DataflowGraph

Struct DataflowGraph 

Source
pub struct DataflowGraph<N, E, L, C> { /* private fields */ }
Expand description

Immutable, canonically ordered, content-identified dataflow structure.

The generic parameters represent graph identities, locations, and edge classes only. Adapters may project machine code, syntax trees, or other located artifacts into these neutral values without storing their source types in the graph.

Implementations§

Source§

impl<N, E, L, C> DataflowGraph<N, E, L, C>
where N: Clone + Hash + Ord, E: Clone + Hash + Ord, L: Hash + Ord, C: Hash + Ord,

Source

pub fn build( nodes: impl IntoIterator<Item = NodeSpec<N, L>>, edges: impl IntoIterator<Item = EdgeSpec<E, N, C>>, ) -> Result<Self, GraphBuildError<N, E>>

Validates and freezes graph declarations in canonical identity order.

Source

pub fn node(&self, id: &N) -> Option<&Node<N, L>>

Returns a node by stable identity.

Source

pub fn edge(&self, id: &E) -> Option<&Edge<E, N, C>>

Returns an edge by stable identity.

Source

pub fn nodes(&self) -> impl ExactSizeIterator<Item = &Node<N, L>>

Iterates nodes in stable identity order.

Source

pub fn edges(&self) -> impl ExactSizeIterator<Item = &Edge<E, N, C>>

Iterates edges in stable identity order.

Source

pub fn predecessors(&self, node: &N) -> Option<&[E]>

Returns incoming edge identities in stable order.

Source

pub fn successors(&self, node: &N) -> Option<&[E]>

Returns outgoing edge identities in stable order.

Source

pub fn fingerprint(&self) -> ValueFingerprint

Returns the canonical content fingerprint.

Trait Implementations§

Source§

impl<N: Clone, E: Clone, L: Clone, C: Clone> Clone for DataflowGraph<N, E, L, C>

Source§

fn clone(&self) -> DataflowGraph<N, E, L, C>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<N: Debug, E: Debug, L: Debug, C: Debug> Debug for DataflowGraph<N, E, L, C>

Source§

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

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

impl<N: Eq, E: Eq, L: Eq, C: Eq> Eq for DataflowGraph<N, E, L, C>

Source§

impl<N: PartialEq, E: PartialEq, L: PartialEq, C: PartialEq> PartialEq for DataflowGraph<N, E, L, C>

Source§

fn eq(&self, other: &DataflowGraph<N, E, L, C>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<N: PartialEq, E: PartialEq, L: PartialEq, C: PartialEq> StructuralPartialEq for DataflowGraph<N, E, L, C>

Auto Trait Implementations§

§

impl<N, E, L, C> Freeze for DataflowGraph<N, E, L, C>

§

impl<N, E, L, C> RefUnwindSafe for DataflowGraph<N, E, L, C>

§

impl<N, E, L, C> Send for DataflowGraph<N, E, L, C>
where N: Send, E: Send, L: Send, C: Send,

§

impl<N, E, L, C> Sync for DataflowGraph<N, E, L, C>
where N: Sync, E: Sync, L: Sync, C: Sync,

§

impl<N, E, L, C> Unpin for DataflowGraph<N, E, L, C>

§

impl<N, E, L, C> UnsafeUnpin for DataflowGraph<N, E, L, C>

§

impl<N, E, L, C> UnwindSafe for DataflowGraph<N, E, L, C>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.