Skip to main content

serve_session

Function serve_session 

Source
pub fn serve_session<C, R, W>(
    child: C,
    inbound: R,
    outbound: W,
) -> Result<SessionExit>
where C: SessionChild, R: Read + Send + 'static, W: Write + Send + 'static,
Expand description

Drive child as a proxied session over a byte transport.

Inbound SessionFrames are decoded off inbound and applied to the child’s stdin; the child’s stdout/stderr/exit are encoded onto outbound. Returns the child’s SessionExit once it exits, inbound reaches EOF, and every outbound frame has been flushed. An Err reflects a transport or reap failure, never stdio content.

child must have all three stdio streams piped (use spawn_contained_session).