pub struct TeeHandle { /* private fields */ }Expand description
A cheaply-cloneable handle for adding or removing a Tee’s sinks
while the pipeline is running. It deliberately keeps only a Weak
reference to the Tee’s shared state: retaining a handle after the
pipeline finishes must not keep downstream sinks or the pipeline’s
crate::bus::Bus sender alive. Once the Tee is gone,
TeeHandle::branch returns None.
Implementations§
Source§impl TeeHandle
impl TeeHandle
Sourcepub fn branch(&self) -> Option<ChainBuilder>
pub fn branch(&self) -> Option<ChainBuilder>
A crate::pipeline::ChainBuilder pre-wired with this Tee’s own
Context — lets a caller build a whole new branch (.pipe(...)
chains, ending in .to(...)) at any point after the pipeline
started running, then hand the result to TeeHandle::attach,
without needing to retain the pipeline context separately
around separately. Returns None once the Tee has been dropped.
Sourcepub fn attach(&self, branch: DetachedBranch) -> Result<BranchId>
pub fn attach(&self, branch: DetachedBranch) -> Result<BranchId>
Attaches a runtime branch, returning the stable ID used to remove it.
Fixed initial branches belong in TeeBuilder.
Sourcepub fn detach(&self, branch_id: BranchId) -> Result<()>
pub fn detach(&self, branch_id: BranchId) -> Result<()>
Detaches exactly the branch returned by TeeHandle::attach. The
runtime peer and every graph node owned by it disappear in the same
transaction. Names are deliberately not used as graph keys.
Sourcepub fn detach_branch_containing(&self, element: ElementId) -> Result<()>
pub fn detach_branch_containing(&self, element: ElementId) -> Result<()>
Resolves the owning branch from any element ID inside it and detaches that branch. Useful when an error is attributed to a stage behind a queue rather than to the branch root.