pub struct Graph { /* private fields */ }Expand description
A decode graph under construction.
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn with_config(config: GraphConfig) -> Self
pub fn with_config(config: GraphConfig) -> Self
An empty graph with config’s limits.
Sourcepub fn config(&self) -> GraphConfig
pub fn config(&self) -> GraphConfig
The graph’s limits.
Sourcepub fn source(&mut self, spec: SourceSpec) -> Result<SourceHandle, GraphError>
pub fn source(&mut self, spec: SourceSpec) -> Result<SourceHandle, GraphError>
Adds a source of logic samples.
Sourcepub fn connect<T>(
&mut self,
from: OutputRef<T>,
to: InputRef<T>,
) -> Result<(), GraphError>
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.
Sourcepub fn expose<T>(
&mut self,
name: impl Into<String>,
from: OutputRef<T>,
) -> Result<ExposedRef<T>, GraphError>
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.
Sourcepub fn source_output(&self, source: SourceId) -> Result<DynOutput, GraphError>
pub fn source_output(&self, source: SourceId) -> Result<DynOutput, GraphError>
The samples output of source, for a graph built from a description.
Sourcepub fn output(&self, node: NodeId, name: &str) -> Result<DynOutput, GraphError>
pub fn output(&self, node: NodeId, name: &str) -> Result<DynOutput, GraphError>
Output port name of node, for a graph built from a description.
Sourcepub fn input(&self, node: NodeId, name: &str) -> Result<DynInput, GraphError>
pub fn input(&self, node: NodeId, name: &str) -> Result<DynInput, GraphError>
Input port name of node, for a graph built from a description.
Sourcepub fn connect_dyn(
&mut self,
from: DynOutput,
to: DynInput,
) -> Result<(), GraphError>
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.
Sourcepub fn expose_dyn(
&mut self,
name: impl Into<String>,
from: DynOutput,
) -> Result<DynExposedRef, GraphError>
pub fn expose_dyn( &mut self, name: impl Into<String>, from: DynOutput, ) -> Result<DynExposedRef, GraphError>
Exposes an output named at run time under name.
Sourcepub fn schema_of(&self, output: DynOutput) -> Result<SchemaId, GraphError>
pub fn schema_of(&self, output: DynOutput) -> Result<SchemaId, GraphError>
The schema of the output behind a port named at run time.
Sourcepub fn props_of(&self, output: DynOutput) -> Result<Props, GraphError>
pub fn props_of(&self, output: DynOutput) -> Result<Props, GraphError>
The properties the output behind a port named at run time declares.
Sourcepub fn build(self) -> Result<Pipeline, GraphError>
pub fn build(self) -> Result<Pipeline, GraphError>
Checks the graph and starts its nodes.