pub struct Outbound {
pub data: Sender<DataFrame>,
pub sys: Sender<(Direction, SystemFrame)>,
}Expand description
The send surface of a stage: typed sends for the data and system lanes.
send_data targets the downstream data lane; send_system targets the
system lane with an explicit Direction.
Fields§
§data: Sender<DataFrame>Downstream data channel.
sys: Sender<(Direction, SystemFrame)>Bidirectional system channel.
Implementations§
Source§impl Outbound
impl Outbound
Sourcepub async fn send_data(&self, frame: DataFrame) -> Result<(), SendError>
pub async fn send_data(&self, frame: DataFrame) -> Result<(), SendError>
Send a data frame downstream.
Takes &self (not &mut self) so a stage can send while it is borrowed
immutably by the run loop. futures’ Sink::send needs &mut, so we
send on a cheap clone of the shared sender; clones feed the same channel.
Sourcepub async fn send_system(
&self,
dir: Direction,
frame: SystemFrame,
) -> Result<(), SendError>
pub async fn send_system( &self, dir: Direction, frame: SystemFrame, ) -> Result<(), SendError>
Send a system frame in the given direction. Takes &self for the same
reason as send_data.
Auto Trait Implementations§
impl !RefUnwindSafe for Outbound
impl !UnwindSafe for Outbound
impl Freeze for Outbound
impl Send for Outbound
impl Sync for Outbound
impl Unpin for Outbound
impl UnsafeUnpin for Outbound
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