use ;
use crate;
/// Copy bytes from the reader into the buffer and return amount of data read.
/// - If an EOF is reached the function will return a ``WebSocketError::Custom``because no more bytes can be read.
/// - If there's no bytes ready to read from the reader the function will return ``Ok(0)`` bytes readed and the buffer will not be modified.
/// - If there's bytes the function will return ``Ok(n)`` where 0 < n <= buf.len()
/// - Otherwise a ``WebSocketError::IOError`` will be return.