Host

Trait Host 

Source
pub trait Host {
    // Required method
    fn read_via_stream(
        &mut self,
    ) -> Result<(StreamReader<u8>, FutureReader<Result<(), ErrorCode>>)>;
}
Available on crate feature p3 only.

Required Methods§

Source

fn read_via_stream( &mut self, ) -> Result<(StreamReader<u8>, FutureReader<Result<(), ErrorCode>>)>

Return a stream for reading from stdin.

This function returns a stream which provides data read from stdin, and a future to signal read results.

If the stream’s readable end is dropped the future will resolve to success.

If the stream’s writable end is dropped the future will either resolve to success if stdin was closed by the writer or to an error-code if reading failed for some other reason.

Multiple streams may be active at the same time. The behavior of concurrent reads is implementation-specific.

Implementations on Foreign Types§

Source§

impl<_T: Host + ?Sized> Host for &mut _T

Source§

fn read_via_stream( &mut self, ) -> Result<(StreamReader<u8>, FutureReader<Result<(), ErrorCode>>)>

Return a stream for reading from stdin.

This function returns a stream which provides data read from stdin, and a future to signal read results.

If the stream’s readable end is dropped the future will resolve to success.

If the stream’s writable end is dropped the future will either resolve to success if stdin was closed by the writer or to an error-code if reading failed for some other reason.

Multiple streams may be active at the same time. The behavior of concurrent reads is implementation-specific.

Implementors§