pub struct GraphPartition { /* private fields */ }distributed only.Expand description
A single local partition wrapping a Graph plus its boundary ports.
GraphPartition is a thin convenience wrapper: it owns the local sub-graph
and the boundary declaration, and delegates GraphPartition::compile and
GraphPartition::process_cycle straight to the inner Graph. The
RT-safety contract of Graph::process_cycle is therefore unchanged.
Implementations§
Source§impl GraphPartition
impl GraphPartition
Sourcepub fn new(graph: Graph, boundary: Vec<BoundaryPort>) -> Self
pub fn new(graph: Graph, boundary: Vec<BoundaryPort>) -> Self
Creates a new partition wrapping graph with the given boundary
ports.
Sourcepub fn compile(&mut self, config: GraphConfig) -> Result<(), GraphError>
pub fn compile(&mut self, config: GraphConfig) -> Result<(), GraphError>
Compiles the inner graph (delegates to Graph::compile).
§Errors
Returns GraphError::AlreadyCompiled if the graph was already
compiled, or GraphError::CycleDetected if the topology contains a
cycle.
Sourcepub fn process_cycle(
&mut self,
ctx: &mut ProcessContext,
) -> Result<(), GraphError>
pub fn process_cycle( &mut self, ctx: &mut ProcessContext, ) -> Result<(), GraphError>
Processes one audio cycle on the inner graph (delegates to
Graph::process_cycle).
§Errors
Returns GraphError::NotCompiled if the graph has not been compiled.
Sourcepub fn boundary(&self) -> &[BoundaryPort]
pub fn boundary(&self) -> &[BoundaryPort]
Returns the boundary ports of this partition.