Trait il2_iltags::io::Reader [−][src]
pub trait Reader {
fn read(&mut self) -> Result<u8>;
fn read_all(&mut self, buff: &mut [u8]) -> Result<()> { ... }
fn skip(&mut self, count: usize) -> Result<()> { ... }
fn skip_u64(&mut self, count: u64) -> Result<()> { ... }
}
Expand description
The Reader
trait is allows the extraction of bytes from a source.
It differs from most IO library as it defines all operations as all-or-nothing operations. No partial reads are allowed.
Implementations of this trait are not required to be thread-safe.
Required methods
Provided methods
Reads the specified number of bytes from the source.
The default implementation just calls read() repeatedly, so each implementation is advised to provide a better implementation of this method if possible.
Arguments:
buff
: The output buffer;
Returns:
Ok(())
: On success;Err(ErrorKind)
: In case of error;
Skips some bytes from the source.
The default implementation just calls read_all() repeatedly using 512 byte chunks. So it is recommended provide better implementations whenever possible.
Arguments:
count
: Number of byte to skip;
Returns:
Ok(())
: On success;Err(ErrorKind)
: In case of error;
Skips some bytes from the source using a u64 as its size. On
64-bit systems, this is equivalent to Self::skip()
as
usize is a 64-bit value.
This method will make a difference in 32-bit systems where usize is actually a 32-bit value.
This implementation calls Self::skip()
as may times
as necessary to skip the required number of bytes.
Arguments:
count
: Number of byte to skip;
Returns:
Ok(())
: On success;Err(ErrorKind)
: In case of error;
New since 1.4.0.
Trait Implementations
Deserializes an ILInt value. Read more
Reads the ILInt. Read more
Deserializes an ILInt value. Read more
Reads the ILInt. Read more
Deserializes the value. Read more
Deserializes the value. Read more
Deserializes the value. Read more
Deserializes the value. Read more
Deserializes the value. Read more
Deserializes the value. Read more
Deserializes the value. Read more
Deserializes the value. Read more
Deserializes the value. Read more
Deserializes the value. Read more
Reads the value. Read more
Reads the value. Read more
Reads the value. Read more
Reads the value. Read more
Reads the value. Read more
Reads the value. Read more
Reads the value. Read more
Reads the value. Read more
Reads the value. Read more
Reads the value. Read more