Skip to main content

Graph

Struct Graph 

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

A decode graph under construction.

Implementations§

Source§

impl Graph

Source

pub fn new() -> Self

An empty graph with the default limits.

Source

pub fn with_config(config: GraphConfig) -> Self

An empty graph with config’s limits.

Source

pub fn config(&self) -> GraphConfig

The graph’s limits.

Source

pub fn source(&mut self, spec: SourceSpec) -> Result<SourceHandle, GraphError>

Adds a source of logic samples.

Source

pub fn add(&mut self, node: impl Node) -> NodeId

Adds a node.

Source

pub fn connect<T>( &mut self, from: OutputRef<T>, to: InputRef<T>, ) -> Result<(), GraphError>

Connects an output to an input, checking that they carry the same schema and that the output satisfies what the input requires.

Source

pub fn expose<T>( &mut self, name: impl Into<String>, from: OutputRef<T>, ) -> Result<ExposedRef<T>, GraphError>

Exposes an output under name, to be read from the pipeline.

Source

pub fn source_output(&self, source: SourceId) -> Result<DynOutput, GraphError>

The samples output of source, for a graph built from a description.

Source

pub fn output(&self, node: NodeId, name: &str) -> Result<DynOutput, GraphError>

Output port name of node, for a graph built from a description.

Source

pub fn input(&self, node: NodeId, name: &str) -> Result<DynInput, GraphError>

Input port name of node, for a graph built from a description.

Source

pub fn connect_dyn( &mut self, from: DynOutput, to: DynInput, ) -> Result<(), GraphError>

Connects ports named at run time, with the checks of Graph::connect; the schema check is what keeps the event types straight here.

Source

pub fn expose_dyn( &mut self, name: impl Into<String>, from: DynOutput, ) -> Result<DynExposedRef, GraphError>

Exposes an output named at run time under name.

Source

pub fn schema_of(&self, output: DynOutput) -> Result<SchemaId, GraphError>

The schema of the output behind a port named at run time.

Source

pub fn props_of(&self, output: DynOutput) -> Result<Props, GraphError>

The properties the output behind a port named at run time declares.

Source

pub fn build(self) -> Result<Pipeline, GraphError>

Checks the graph and starts its nodes.

Trait Implementations§

Source§

impl Debug for Graph

Source§

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

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

impl Default for Graph

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl !RefUnwindSafe for Graph

§

impl !Send for Graph

§

impl !Sync for Graph

§

impl !UnwindSafe for Graph

§

impl Freeze for Graph

§

impl Unpin for Graph

§

impl UnsafeUnpin for Graph

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.