pub struct SourceHandle { /* private fields */ }Expand description
A clonable handle a source’s reader task uses to inject frames into the pipeline
head. Thin wrapper over the PipelineTask head queue so
transport authors call emit/end instead of touching the raw channel.
Implementations§
Source§impl SourceHandle
impl SourceHandle
Sourcepub fn new(head: UnboundedSender<Frame>) -> Self
pub fn new(head: UnboundedSender<Frame>) -> Self
Wrap a PipelineTask::queue_sender
handle.
Sourcepub fn emit(&self, frame: Frame) -> Result<(), Frame>
pub fn emit(&self, frame: Frame) -> Result<(), Frame>
Inject one frame at the pipeline head (flows downstream). Returns Err if
the pipeline has shut down (the reader should then stop). Mirrors pipecat
BaseInputTransport.push_frame from the reader task.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SourceHandle
impl RefUnwindSafe for SourceHandle
impl Send for SourceHandle
impl Sync for SourceHandle
impl Unpin for SourceHandle
impl UnsafeUnpin for SourceHandle
impl UnwindSafe for SourceHandle
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