Skip to main content

GraphBuilder

Struct GraphBuilder 

Source
pub struct GraphBuilder { /* private fields */ }
Expand description

Mutable scratch state for assembling a dynamic graph inside a GraphDsl closure.

Tracks registered stages, their ports, the edges wired between them, and any deferred wiring errors (raised by wire, which collects rather than short-circuits). finish consumes it into a validated GraphBlueprint. Use this builder for cycles, runtime-data-dependent topology, erased interop, connect_any, and method-based wire construction. For static typed graphs where double-wiring should be rejected by Rust moves, use TypedGraphBuilder.

Implementations§

Source§

impl GraphBuilder

Source

pub fn add<G: GraphStage>(&mut self, stage: G) -> G::Shape

Source

pub fn add_with_attributes<G: GraphStage>( &mut self, stage: G, attributes: Attributes, ) -> G::Shape

Source

pub fn add_named<G: GraphStage>( &mut self, stage: G, name: impl Into<String>, ) -> G::Shape

Source

pub fn connect<T: 'static>( &mut self, outlet: Outlet<T>, inlet: Inlet<T>, ) -> StreamResult<()>

Source

pub fn connect_any( &mut self, outlet: AnyOutlet, inlet: AnyInlet, ) -> StreamResult<()>

Connect type-erased ports for dynamic graph construction and interop.

This remains an explicit compatibility surface for cases where the element type is only known at runtime. Prefer connect or TypedGraphBuilder for static Rust graphs.

Source

pub fn import<S: Shape>(&mut self, graph: &PartialGraph<S>) -> StreamResult<S>

Source

pub fn wire<W: WireSpec>(&mut self, spec: W) -> &mut Self

Apply a dynamic/method-based wiring spec, deferring errors to finish.

wire is useful for graph DSL ergonomics and interop-style topology construction. Static Rust graphs can use TypedGraphBuilder when compile-time double-wire rejection is desired.

Source

pub fn try_wire<W: WireSpec>(&mut self, spec: W) -> StreamResult<&mut Self>

Apply a dynamic/method-based wiring spec, returning wiring errors immediately.

This is the fallible counterpart to wire and remains a runtime-validated dynamic/interop surface.

Trait Implementations§

Source§

impl Debug for GraphBuilder

Source§

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

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

impl Default for GraphBuilder

Source§

fn default() -> GraphBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Message for T
where T: Any + Send + 'static,

Source§

fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>

Convert a BoxedMessage to this concrete type
Source§

fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>

Convert this message to a BoxedMessage
Source§

impl<T> State for T
where T: Any + Send + 'static,

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more