Struct GraphBuilder

Source
pub struct GraphBuilder<Id: Hash + Eq + Copy, N: Node> { /* private fields */ }
Expand description

Builds a CompiledGraph from the specified nodes and connections

This basically means a topological sort so that nodes are executed after their dependencies

Implementations§

Source§

impl<Id: Hash + Eq + Copy, N: Node> GraphBuilder<Id, N>
where N::Config: Default,

Source

pub fn new() -> Self

Source§

impl<Id: Hash + Eq + Copy, N: Node> GraphBuilder<Id, N>

Source

pub fn new_with_config(config: N::Config) -> Self

Source

pub fn add_node( &mut self, id: Id, node: impl Into<N>, ) -> Result<(), DuplicateId>

Source

pub fn add_connection(&mut self, connection: Connection<Id>)

Source

pub fn build(self) -> Result<CompiledGraph<Id, N>, BuildError<Id>>

Auto Trait Implementations§

§

impl<Id, N> Freeze for GraphBuilder<Id, N>
where <N as Node>::Config: Freeze,

§

impl<Id, N> RefUnwindSafe for GraphBuilder<Id, N>

§

impl<Id, N> Send for GraphBuilder<Id, N>
where <N as Node>::Config: Send, Id: Send, N: Send, <N as Node>::Data: Send,

§

impl<Id, N> Sync for GraphBuilder<Id, N>
where <N as Node>::Config: Sync, Id: Sync, N: Sync, <N as Node>::Data: Sync,

§

impl<Id, N> Unpin for GraphBuilder<Id, N>
where <N as Node>::Config: Unpin, Id: Unpin, N: Unpin, <N as Node>::Data: Unpin,

§

impl<Id, N> UnwindSafe for GraphBuilder<Id, N>
where <N as Node>::Config: UnwindSafe, Id: UnwindSafe, N: UnwindSafe, <N as Node>::Data: 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, 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.