read_exact
fn read_exact(Stream s, Vec<byte> buf) -> Result<Option<int>, IoError> Import
Source: use io::sync::{read_exact}; src/io/sync.hy Fills all of buf from s, waiting whenever no data is ready.
Returns Some(n): n is buf.len() once buf is full, or fewer when the
stream ends part way. Returns None when the stream ends before any byte.
Parameters#
| Name | Type |
|---|---|
s | Stream |
buf | Vec<byte> |
Returns#
Result<Option<int>, IoError>
See also#
write_all: Writes all ofbuftos, waiting whenever the stream is not ready.read_to_end: Reads fromsuntil it ends and returns everything read.accept_wait: Waits for the next connection on a TCPlistenerand returns its stream.recv_from_wait: Waits for a UDP datagram, reads it intobuf, and returns(bytes, sender host, sender port).send_to_wait: Sendsbufas one UDP datagram tohost:port, waiting while the socket is not ready.copy: Copies the filesrctodst.print: Writessto standard output, without a newline.println: Writessand a newline to standard output.