pub struct GraphBuilder<State> { /* private fields */ }Expand description
Builder for constructing filter graphs with type-state pattern.
The builder ensures that graphs are constructed correctly:
- Add nodes
- Connect nodes
- Build the graph
Implementations§
Source§impl GraphBuilder<Empty>
impl GraphBuilder<Empty>
Source§impl GraphBuilder<HasNodes>
impl GraphBuilder<HasNodes>
Sourcepub fn connect(
self,
from_node: NodeId,
from_port: PortId,
to_node: NodeId,
to_port: PortId,
) -> GraphResult<GraphBuilder<HasConnections>>
pub fn connect( self, from_node: NodeId, from_port: PortId, to_node: NodeId, to_port: PortId, ) -> GraphResult<GraphBuilder<HasConnections>>
Connect two nodes.
Sourcepub fn build(self) -> GraphResult<FilterGraph>
pub fn build(self) -> GraphResult<FilterGraph>
Build the graph without any connections (single node graph).
Source§impl GraphBuilder<HasConnections>
impl GraphBuilder<HasConnections>
Sourcepub fn connect(
self,
from_node: NodeId,
from_port: PortId,
to_node: NodeId,
to_port: PortId,
) -> GraphResult<Self>
pub fn connect( self, from_node: NodeId, from_port: PortId, to_node: NodeId, to_port: PortId, ) -> GraphResult<Self>
Add another connection.
Sourcepub fn build(self) -> GraphResult<FilterGraph>
pub fn build(self) -> GraphResult<FilterGraph>
Build the filter graph.
Trait Implementations§
Auto Trait Implementations§
impl<State> !RefUnwindSafe for GraphBuilder<State>
impl<State> !UnwindSafe for GraphBuilder<State>
impl<State> Freeze for GraphBuilder<State>
impl<State> Send for GraphBuilder<State>where
State: Send,
impl<State> Sync for GraphBuilder<State>where
State: Sync,
impl<State> Unpin for GraphBuilder<State>where
State: Unpin,
impl<State> UnsafeUnpin for GraphBuilder<State>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more