pub struct Cursor<T> { /* private fields */ }core_io)Expand description
A Cursor wraps an in-memory buffer and provides it with a
Seek implementation.
Cursors are used with in-memory buffers, anything implementing
AsRef<[u8]>, to allow them to implement Read and/or Write,
allowing these buffers to be used anywhere you might use a reader or writer
that does actual I/O.
The standard library implements some I/O traits on various types which
are commonly used as a buffer, like Cursor<Vec<u8>> and
Cursor<&[u8]>.
ยงExamples
We may want to write bytes to a File in our production
code, but use an in-memory buffer in our tests. We can do this with
Cursor:
use std::io::prelude::*;
use std::io::{self, SeekFrom};
use std::fs::File;
// a library function we've written
fn write_ten_bytes_at_end<W: Write + Seek>(mut writer: W) -> io::Result<()> {
writer.seek(SeekFrom::End(-10))?;
for i in 0..10 {
writer.write(&[i])?;
}
// all went well
Ok(())
}
// Here's some code that uses this library function.
//
// We might want to use a BufReader here for efficiency, but let's
// keep this example focused.
let mut file = File::create("foo.txt")?;
// First, we need to allocate 10 bytes to be able to write into.
file.set_len(10)?;
write_ten_bytes_at_end(&mut file)?;
// now let's write a test
#[test]
fn test_writes_bytes() {
// setting up a real File is much slower than an in-memory buffer,
// let's use a cursor instead
use std::io::Cursor;
let mut buff = Cursor::new(vec![0; 15]);
write_ten_bytes_at_end(&mut buff).unwrap();
assert_eq!(&buff.get_ref()[5..15], &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
}Implementationsยง
Sourceยงimpl<T> Cursor<T>
impl<T> Cursor<T>
1.0.0 (const: 1.79.0) ยท Sourcepub const fn new(inner: T) -> Cursor<T> โ
pub const fn new(inner: T) -> Cursor<T> โ
Creates a new cursor wrapping the provided underlying in-memory buffer.
Cursor initial position is 0 even if underlying buffer (e.g., Vec)
is not empty. So writing to cursor starts with overwriting Vec
content, not with appending to it.
ยงExamples
use std::io::Cursor;
let buff = Cursor::new(Vec::new());1.0.0 ยท Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes this cursor, returning the underlying value.
ยงExamples
use std::io::Cursor;
let buff = Cursor::new(Vec::new());
let vec = buff.into_inner();1.0.0 (const: 1.79.0) ยท Sourcepub const fn get_ref(&self) -> &T
pub const fn get_ref(&self) -> &T
Gets a reference to the underlying value in this cursor.
ยงExamples
use std::io::Cursor;
let buff = Cursor::new(Vec::new());
let reference = buff.get_ref();1.0.0 (const: 1.86.0) ยท Sourcepub const fn get_mut(&mut self) -> &mut T
pub const fn get_mut(&mut self) -> &mut T
Gets a mutable reference to the underlying value in this cursor.
Care should be taken to avoid modifying the internal I/O state of the underlying value as it may corrupt this cursorโs position.
ยงExamples
use std::io::Cursor;
let mut buff = Cursor::new(Vec::new());
let reference = buff.get_mut();1.0.0 (const: 1.79.0) ยท Sourcepub const fn position(&self) -> u64
pub const fn position(&self) -> u64
Returns the current position of this cursor.
ยงExamples
use std::io::Cursor;
use std::io::prelude::*;
use std::io::SeekFrom;
let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]);
assert_eq!(buff.position(), 0);
buff.seek(SeekFrom::Current(2)).unwrap();
assert_eq!(buff.position(), 2);
buff.seek(SeekFrom::Current(-1)).unwrap();
assert_eq!(buff.position(), 1);1.0.0 (const: 1.86.0) ยท Sourcepub const fn set_position(&mut self, pos: u64)
pub const fn set_position(&mut self, pos: u64)
Sets the position of this cursor.
ยงExamples
use std::io::Cursor;
let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]);
assert_eq!(buff.position(), 0);
buff.set_position(2);
assert_eq!(buff.position(), 2);
buff.set_position(4);
assert_eq!(buff.position(), 4);Sourceยงimpl<T> Cursor<T>
impl<T> Cursor<T>
Sourcepub fn split(&self) -> (&[u8], &[u8])
๐ฌThis is a nightly-only experimental API. (cursor_split)
pub fn split(&self) -> (&[u8], &[u8])
cursor_split)Splits the underlying slice at the cursor position and returns them.
ยงExamples
#![feature(cursor_split)]
use std::io::Cursor;
let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]);
assert_eq!(buff.split(), ([].as_slice(), [1, 2, 3, 4, 5].as_slice()));
buff.set_position(2);
assert_eq!(buff.split(), ([1, 2].as_slice(), [3, 4, 5].as_slice()));
buff.set_position(6);
assert_eq!(buff.split(), ([1, 2, 3, 4, 5].as_slice(), [].as_slice()));Sourceยงimpl<T> Cursor<T>
impl<T> Cursor<T>
Sourcepub fn split_mut(&mut self) -> (&mut [u8], &mut [u8])
๐ฌThis is a nightly-only experimental API. (cursor_split)
pub fn split_mut(&mut self) -> (&mut [u8], &mut [u8])
cursor_split)Splits the underlying slice at the cursor position and returns them mutably.
ยงExamples
#![feature(cursor_split)]
use std::io::Cursor;
let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]);
assert_eq!(buff.split_mut(), ([].as_mut_slice(), [1, 2, 3, 4, 5].as_mut_slice()));
buff.set_position(2);
assert_eq!(buff.split_mut(), ([1, 2].as_mut_slice(), [3, 4, 5].as_mut_slice()));
buff.set_position(6);
assert_eq!(buff.split_mut(), ([1, 2, 3, 4, 5].as_mut_slice(), [].as_mut_slice()));Trait Implementationsยง
1.0.0 ยท Sourceยงimpl<T> BufRead for Cursor<T>
impl<T> BufRead for Cursor<T>
Sourceยงfn fill_buf(&mut self) -> Result<&[u8], Error>
fn fill_buf(&mut self) -> Result<&[u8], Error>
Read methods, if empty. Read moreSourceยงfn consume(&mut self, amt: usize)
fn consume(&mut self, amt: usize)
amount of additional bytes from the internal buffer as having been read.
Subsequent calls to read only return bytes that have not been marked as read. Read moreSourceยงfn has_data_left(&mut self) -> Result<bool, Error>
fn has_data_left(&mut self) -> Result<bool, Error>
buf_read_has_data_left)read. Read more1.83.0 ยท Sourceยงfn skip_until(&mut self, byte: u8) -> Result<usize, Error>
fn skip_until(&mut self, byte: u8) -> Result<usize, Error>
byte or EOF is reached. Read more1.0.0 ยท Sourceยงfn read_line(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_line(&mut self, buf: &mut String) -> Result<usize, Error>
0xA byte) is reached, and append
them to the provided String buffer. Read moreimpl<T> Eq for Cursor<T>where
T: Eq,
1.0.0 ยท Sourceยงimpl<T> PartialEq for Cursor<T>where
T: PartialEq,
impl<T> PartialEq for Cursor<T>where
T: PartialEq,
1.0.0 ยท Sourceยงimpl<T> Read for Cursor<T>
impl<T> Read for Cursor<T>
Sourceยงfn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
Sourceยงfn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf)Sourceยงfn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read, except that it reads into a slice of buffers. Read moreSourceยงfn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector)Sourceยงfn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf. Read moreSourceยงfn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf)cursor. Read moreSourceยงfn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
buf. Read moreSourceยงfn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf. Read more1.0.0 ยท Sourceยงfn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Read. Read more1.0.0 ยท Sourceยงfn chain<R>(self, next: R) -> Chain<Self, R> โ
fn chain<R>(self, next: R) -> Chain<Self, R> โ
1.0.0 ยท Sourceยงimpl<T> Seek for Cursor<T>
impl<T> Seek for Cursor<T>
Sourceยงfn seek(&mut self, style: SeekFrom) -> Result<u64, Error>
fn seek(&mut self, style: SeekFrom) -> Result<u64, Error>
Sourceยงfn stream_len(&mut self) -> Result<u64, Error>
fn stream_len(&mut self) -> Result<u64, Error>
seek_stream_len)Sourceยงfn stream_position(&mut self) -> Result<u64, Error>
fn stream_position(&mut self) -> Result<u64, Error>
impl<T> StructuralPartialEq for Cursor<T>
1.0.0 ยท Sourceยงimpl Write for Cursor<&mut [u8]>
impl Write for Cursor<&mut [u8]>
Sourceยงfn write(&mut self, buf: &[u8]) -> Result<usize, Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Sourceยงfn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector)Sourceยงfn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Sourceยงfn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored)Sourceยงfn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
1.25.0 ยท Sourceยงimpl<A> Write for Cursor<&mut Vec<u8, A>>where
A: Allocator,
impl<A> Write for Cursor<&mut Vec<u8, A>>where
A: Allocator,
Sourceยงfn write(&mut self, buf: &[u8]) -> Result<usize, Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Sourceยงfn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector)Sourceยงfn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Sourceยงfn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored)Sourceยงfn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
1.0.0 ยท Sourceยงimpl<A> Write for Cursor<Vec<u8, A>>where
A: Allocator,
impl<A> Write for Cursor<Vec<u8, A>>where
A: Allocator,
Sourceยงfn write(&mut self, buf: &[u8]) -> Result<usize, Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Sourceยงfn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector)Sourceยงfn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Sourceยงfn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored)Sourceยงfn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
1.5.0 ยท Sourceยงimpl<A> Write for Cursor<Box<[u8], A>>where
A: Allocator,
impl<A> Write for Cursor<Box<[u8], A>>where
A: Allocator,
Sourceยงfn write(&mut self, buf: &[u8]) -> Result<usize, Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Sourceยงfn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector)Sourceยงfn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Sourceยงfn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored)Sourceยงfn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
1.61.0 ยท Sourceยงimpl<const N: usize> Write for Cursor<[u8; N]>
impl<const N: usize> Write for Cursor<[u8; N]>
Sourceยงfn write(&mut self, buf: &[u8]) -> Result<usize, Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Sourceยงfn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector)Sourceยงfn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Sourceยงfn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored)Sourceยงfn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
Auto Trait Implementationsยง
impl<T> Freeze for Cursor<T>where
T: Freeze,
impl<T> RefUnwindSafe for Cursor<T>where
T: RefUnwindSafe,
impl<T> Send for Cursor<T>where
T: Send,
impl<T> Sync for Cursor<T>where
T: Sync,
impl<T> Unpin for Cursor<T>where
T: Unpin,
impl<T> UnsafeUnpin for Cursor<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Cursor<T>where
T: UnwindSafe,
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self> โ
fn into_either(self, into_left: bool) -> Either<Self, Self> โ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงimpl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Sourceยงimpl<R> ReadBytesExt for R
impl<R> ReadBytesExt for R
Sourceยงfn read_u8(&mut self) -> Result<u8, Error>
fn read_u8(&mut self) -> Result<u8, Error>
Sourceยงfn read_i8(&mut self) -> Result<i8, Error>
fn read_i8(&mut self) -> Result<i8, Error>
Sourceยงfn read_u16<T>(&mut self) -> Result<u16, Error>where
T: ByteOrder,
fn read_u16<T>(&mut self) -> Result<u16, Error>where
T: ByteOrder,
Sourceยงfn read_i16<T>(&mut self) -> Result<i16, Error>where
T: ByteOrder,
fn read_i16<T>(&mut self) -> Result<i16, Error>where
T: ByteOrder,
Sourceยงfn read_u24<T>(&mut self) -> Result<u32, Error>where
T: ByteOrder,
fn read_u24<T>(&mut self) -> Result<u32, Error>where
T: ByteOrder,
Sourceยงfn read_i24<T>(&mut self) -> Result<i32, Error>where
T: ByteOrder,
fn read_i24<T>(&mut self) -> Result<i32, Error>where
T: ByteOrder,
Sourceยงfn read_u32<T>(&mut self) -> Result<u32, Error>where
T: ByteOrder,
fn read_u32<T>(&mut self) -> Result<u32, Error>where
T: ByteOrder,
Sourceยงfn read_i32<T>(&mut self) -> Result<i32, Error>where
T: ByteOrder,
fn read_i32<T>(&mut self) -> Result<i32, Error>where
T: ByteOrder,
Sourceยงfn read_u48<T>(&mut self) -> Result<u64, Error>where
T: ByteOrder,
fn read_u48<T>(&mut self) -> Result<u64, Error>where
T: ByteOrder,
Sourceยงfn read_i48<T>(&mut self) -> Result<i64, Error>where
T: ByteOrder,
fn read_i48<T>(&mut self) -> Result<i64, Error>where
T: ByteOrder,
Sourceยงfn read_u64<T>(&mut self) -> Result<u64, Error>where
T: ByteOrder,
fn read_u64<T>(&mut self) -> Result<u64, Error>where
T: ByteOrder,
Sourceยงfn read_i64<T>(&mut self) -> Result<i64, Error>where
T: ByteOrder,
fn read_i64<T>(&mut self) -> Result<i64, Error>where
T: ByteOrder,
Sourceยงfn read_u128<T>(&mut self) -> Result<u128, Error>where
T: ByteOrder,
fn read_u128<T>(&mut self) -> Result<u128, Error>where
T: ByteOrder,
Sourceยงfn read_i128<T>(&mut self) -> Result<i128, Error>where
T: ByteOrder,
fn read_i128<T>(&mut self) -> Result<i128, Error>where
T: ByteOrder,
Sourceยงfn read_uint<T>(&mut self, nbytes: usize) -> Result<u64, Error>where
T: ByteOrder,
fn read_uint<T>(&mut self, nbytes: usize) -> Result<u64, Error>where
T: ByteOrder,
Sourceยงfn read_int<T>(&mut self, nbytes: usize) -> Result<i64, Error>where
T: ByteOrder,
fn read_int<T>(&mut self, nbytes: usize) -> Result<i64, Error>where
T: ByteOrder,
Sourceยงfn read_uint128<T>(&mut self, nbytes: usize) -> Result<u128, Error>where
T: ByteOrder,
fn read_uint128<T>(&mut self, nbytes: usize) -> Result<u128, Error>where
T: ByteOrder,
Sourceยงfn read_int128<T>(&mut self, nbytes: usize) -> Result<i128, Error>where
T: ByteOrder,
fn read_int128<T>(&mut self, nbytes: usize) -> Result<i128, Error>where
T: ByteOrder,
Sourceยงimpl<R> ReadEndian<[f32]> for Rwhere
R: Read,
impl<R> ReadEndian<[f32]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [f32],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [f32], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [f32]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [f32]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<[f64]> for Rwhere
R: Read,
impl<R> ReadEndian<[f64]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [f64],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [f64], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [f64]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [f64]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<[i8]> for Rwhere
R: Read,
impl<R> ReadEndian<[i8]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [i8],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [i8], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [i8]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [i8]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<[i16]> for Rwhere
R: Read,
impl<R> ReadEndian<[i16]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [i16],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [i16], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [i16]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [i16]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<[i32]> for Rwhere
R: Read,
impl<R> ReadEndian<[i32]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [i32],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [i32], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [i32]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [i32]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<[i64]> for Rwhere
R: Read,
impl<R> ReadEndian<[i64]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [i64],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [i64], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [i64]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [i64]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<[i128]> for Rwhere
R: Read,
impl<R> ReadEndian<[i128]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [i128],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [i128], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [i128]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [i128]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<[u8]> for Rwhere
R: Read,
impl<R> ReadEndian<[u8]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [u8],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [u8], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [u8]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [u8]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<[u16]> for Rwhere
R: Read,
impl<R> ReadEndian<[u16]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [u16],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [u16], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [u16]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [u16]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<[u32]> for Rwhere
R: Read,
impl<R> ReadEndian<[u32]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [u32],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [u32], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [u32]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [u32]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<[u64]> for Rwhere
R: Read,
impl<R> ReadEndian<[u64]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [u64],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [u64], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [u64]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [u64]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<[u128]> for Rwhere
R: Read,
impl<R> ReadEndian<[u128]> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut [u128],
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut [u128], ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut [u128]) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut [u128]) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<f32> for Rwhere
R: Read,
impl<R> ReadEndian<f32> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(&mut self, value: &mut f32) -> Result<(), Error>
fn read_from_little_endian_into(&mut self, value: &mut f32) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut f32) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut f32) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<f64> for Rwhere
R: Read,
impl<R> ReadEndian<f64> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(&mut self, value: &mut f64) -> Result<(), Error>
fn read_from_little_endian_into(&mut self, value: &mut f64) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut f64) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut f64) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<i8> for Rwhere
R: Read,
impl<R> ReadEndian<i8> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(&mut self, value: &mut i8) -> Result<(), Error>
fn read_from_little_endian_into(&mut self, value: &mut i8) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut i8) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut i8) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<i16> for Rwhere
R: Read,
impl<R> ReadEndian<i16> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(&mut self, value: &mut i16) -> Result<(), Error>
fn read_from_little_endian_into(&mut self, value: &mut i16) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut i16) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut i16) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<i32> for Rwhere
R: Read,
impl<R> ReadEndian<i32> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(&mut self, value: &mut i32) -> Result<(), Error>
fn read_from_little_endian_into(&mut self, value: &mut i32) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut i32) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut i32) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<i64> for Rwhere
R: Read,
impl<R> ReadEndian<i64> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(&mut self, value: &mut i64) -> Result<(), Error>
fn read_from_little_endian_into(&mut self, value: &mut i64) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut i64) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut i64) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<i128> for Rwhere
R: Read,
impl<R> ReadEndian<i128> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut i128,
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut i128, ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut i128) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut i128) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<u8> for Rwhere
R: Read,
impl<R> ReadEndian<u8> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(&mut self, value: &mut u8) -> Result<(), Error>
fn read_from_little_endian_into(&mut self, value: &mut u8) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut u8) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut u8) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<u16> for Rwhere
R: Read,
impl<R> ReadEndian<u16> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(&mut self, value: &mut u16) -> Result<(), Error>
fn read_from_little_endian_into(&mut self, value: &mut u16) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut u16) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut u16) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<u32> for Rwhere
R: Read,
impl<R> ReadEndian<u32> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(&mut self, value: &mut u32) -> Result<(), Error>
fn read_from_little_endian_into(&mut self, value: &mut u32) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut u32) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut u32) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<u64> for Rwhere
R: Read,
impl<R> ReadEndian<u64> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(&mut self, value: &mut u64) -> Result<(), Error>
fn read_from_little_endian_into(&mut self, value: &mut u64) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut u64) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut u64) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R> ReadEndian<u128> for Rwhere
R: Read,
impl<R> ReadEndian<u128> for Rwhere
R: Read,
Sourceยงfn read_from_little_endian_into(
&mut self,
value: &mut u128,
) -> Result<(), Error>
fn read_from_little_endian_into( &mut self, value: &mut u128, ) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_big_endian_into(&mut self, value: &mut u128) -> Result<(), Error>
fn read_from_big_endian_into(&mut self, value: &mut u128) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
fn read_from_native_endian_into(&mut self, value: &mut T) -> Result<(), Error>
std::io::Read::read_exact.Sourceยงfn read_from_little_endian(&mut self) -> Result<T, Error>
fn read_from_little_endian(&mut self) -> Result<T, Error>
Sourceยงfn read_from_big_endian(&mut self) -> Result<T, Error>
fn read_from_big_endian(&mut self) -> Result<T, Error>
Sourceยงimpl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Sourceยงfn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Sourceยงimpl<W> WriteBytesExt for W
impl<W> WriteBytesExt for W
Sourceยงfn write_u8(&mut self, n: u8) -> Result<(), Error>
fn write_u8(&mut self, n: u8) -> Result<(), Error>
Sourceยงfn write_i8(&mut self, n: i8) -> Result<(), Error>
fn write_i8(&mut self, n: i8) -> Result<(), Error>
Sourceยงfn write_u16<T>(&mut self, n: u16) -> Result<(), Error>where
T: ByteOrder,
fn write_u16<T>(&mut self, n: u16) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_i16<T>(&mut self, n: i16) -> Result<(), Error>where
T: ByteOrder,
fn write_i16<T>(&mut self, n: i16) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_u24<T>(&mut self, n: u32) -> Result<(), Error>where
T: ByteOrder,
fn write_u24<T>(&mut self, n: u32) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_i24<T>(&mut self, n: i32) -> Result<(), Error>where
T: ByteOrder,
fn write_i24<T>(&mut self, n: i32) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_u32<T>(&mut self, n: u32) -> Result<(), Error>where
T: ByteOrder,
fn write_u32<T>(&mut self, n: u32) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_i32<T>(&mut self, n: i32) -> Result<(), Error>where
T: ByteOrder,
fn write_i32<T>(&mut self, n: i32) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_u48<T>(&mut self, n: u64) -> Result<(), Error>where
T: ByteOrder,
fn write_u48<T>(&mut self, n: u64) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_i48<T>(&mut self, n: i64) -> Result<(), Error>where
T: ByteOrder,
fn write_i48<T>(&mut self, n: i64) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_u64<T>(&mut self, n: u64) -> Result<(), Error>where
T: ByteOrder,
fn write_u64<T>(&mut self, n: u64) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_i64<T>(&mut self, n: i64) -> Result<(), Error>where
T: ByteOrder,
fn write_i64<T>(&mut self, n: i64) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_u128<T>(&mut self, n: u128) -> Result<(), Error>where
T: ByteOrder,
fn write_u128<T>(&mut self, n: u128) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_i128<T>(&mut self, n: i128) -> Result<(), Error>where
T: ByteOrder,
fn write_i128<T>(&mut self, n: i128) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error>where
T: ByteOrder,
fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error>where
T: ByteOrder,
fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error>where
T: ByteOrder,
fn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error>where
T: ByteOrder,
Sourceยงfn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error>where
T: ByteOrder,
fn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error>where
T: ByteOrder,
Sourceยงimpl<W> WriteEndian<[f32]> for Wwhere
W: Write,
impl<W> WriteEndian<[f32]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[f32]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[f32]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<[f64]> for Wwhere
W: Write,
impl<W> WriteEndian<[f64]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[f64]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[f64]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<[i8]> for Wwhere
W: Write,
impl<W> WriteEndian<[i8]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[i8]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[i8]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<[i16]> for Wwhere
W: Write,
impl<W> WriteEndian<[i16]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[i16]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[i16]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<[i32]> for Wwhere
W: Write,
impl<W> WriteEndian<[i32]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[i32]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[i32]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<[i64]> for Wwhere
W: Write,
impl<W> WriteEndian<[i64]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[i64]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[i64]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<[i128]> for Wwhere
W: Write,
impl<W> WriteEndian<[i128]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[i128]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[i128]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<[u8]> for Wwhere
W: Write,
impl<W> WriteEndian<[u8]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[u8]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[u8]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<[u16]> for Wwhere
W: Write,
impl<W> WriteEndian<[u16]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[u16]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[u16]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<[u32]> for Wwhere
W: Write,
impl<W> WriteEndian<[u32]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[u32]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[u32]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<[u64]> for Wwhere
W: Write,
impl<W> WriteEndian<[u64]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[u64]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[u64]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<[u128]> for Wwhere
W: Write,
impl<W> WriteEndian<[u128]> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &[u128]) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &[u128]) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<f32> for Wwhere
W: Write,
impl<W> WriteEndian<f32> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &f32) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &f32) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<f64> for Wwhere
W: Write,
impl<W> WriteEndian<f64> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &f64) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &f64) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<i8> for Wwhere
W: Write,
impl<W> WriteEndian<i8> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &i8) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &i8) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<i16> for Wwhere
W: Write,
impl<W> WriteEndian<i16> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &i16) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &i16) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<i32> for Wwhere
W: Write,
impl<W> WriteEndian<i32> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &i32) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &i32) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<i64> for Wwhere
W: Write,
impl<W> WriteEndian<i64> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &i64) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &i64) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<i128> for Wwhere
W: Write,
impl<W> WriteEndian<i128> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &i128) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &i128) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<u8> for Wwhere
W: Write,
impl<W> WriteEndian<u8> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &u8) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &u8) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<u16> for Wwhere
W: Write,
impl<W> WriteEndian<u16> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &u16) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &u16) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<u32> for Wwhere
W: Write,
impl<W> WriteEndian<u32> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &u32) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &u32) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<u64> for Wwhere
W: Write,
impl<W> WriteEndian<u64> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &u64) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &u64) -> Result<(), Error>
Sourceยงimpl<W> WriteEndian<u128> for Wwhere
W: Write,
impl<W> WriteEndian<u128> for Wwhere
W: Write,
Sourceยงfn write_as_little_endian(&mut self, value: &u128) -> Result<(), Error>
fn write_as_little_endian(&mut self, value: &u128) -> Result<(), Error>
Sourceยงimpl<T> ZByteReaderTrait for T
impl<T> ZByteReaderTrait for T
Sourceยงfn read_byte_no_error(&mut self) -> u8
fn read_byte_no_error(&mut self) -> u8
0 if we canโt read the byte, e.g because of EOF Read moreSourceยงfn read_exact_bytes(&mut self, buf: &mut [u8]) -> Result<(), ZByteIoError>
fn read_exact_bytes(&mut self, buf: &mut [u8]) -> Result<(), ZByteIoError>
buf or return an error if that isnโt possible Read moreSourceยงfn read_const_bytes<const N: usize>(
&mut self,
buf: &mut [u8; N],
) -> Result<(), ZByteIoError>
fn read_const_bytes<const N: usize>( &mut self, buf: &mut [u8; N], ) -> Result<(), ZByteIoError>
buf or return an error if that isnโt possible Read moreSourceยงfn read_const_bytes_no_error<const N: usize>(&mut self, buf: &mut [u8; N])
fn read_const_bytes_no_error<const N: usize>(&mut self, buf: &mut [u8; N])
buf or ignore buf entirely if you canโt fill it
due to an error like the inability to fill the buffer completely Read moreSourceยงfn read_bytes(&mut self, buf: &mut [u8]) -> Result<usize, ZByteIoError>
fn read_bytes(&mut self, buf: &mut [u8]) -> Result<usize, ZByteIoError>
buf returning how many bytes you have read or an error if one occurred Read moreSourceยงfn peek_bytes(&mut self, buf: &mut [u8]) -> Result<usize, ZByteIoError>
fn peek_bytes(&mut self, buf: &mut [u8]) -> Result<usize, ZByteIoError>
fn peek_exact_bytes(&mut self, buf: &mut [u8]) -> Result<(), ZByteIoError>
Sourceยงfn z_seek(&mut self, from: ZSeekFrom) -> Result<u64, ZByteIoError>
fn z_seek(&mut self, from: ZSeekFrom) -> Result<u64, ZByteIoError>
Sourceยงfn is_eof(&mut self) -> Result<bool, ZByteIoError>
fn is_eof(&mut self) -> Result<bool, ZByteIoError>
Sourceยงfn z_position(&mut self) -> Result<u64, ZByteIoError>
fn z_position(&mut self) -> Result<u64, ZByteIoError>
Sourceยงfn read_remaining(&mut self, sink: &mut Vec<u8>) -> Result<usize, ZByteIoError>
fn read_remaining(&mut self, sink: &mut Vec<u8>) -> Result<usize, ZByteIoError>
sink until we hit eof Read moreSourceยงimpl<T> ZByteWriterTrait for Twhere
T: Write,
impl<T> ZByteWriterTrait for Twhere
T: Write,
Sourceยงfn write_bytes(&mut self, buf: &[u8]) -> Result<usize, ZByteIoError>
fn write_bytes(&mut self, buf: &[u8]) -> Result<usize, ZByteIoError>
Sourceยงfn write_all_bytes(&mut self, buf: &[u8]) -> Result<(), ZByteIoError>
fn write_all_bytes(&mut self, buf: &[u8]) -> Result<(), ZByteIoError>
Sourceยงfn write_const_bytes<const N: usize>(
&mut self,
buf: &[u8; N],
) -> Result<(), ZByteIoError>
fn write_const_bytes<const N: usize>( &mut self, buf: &[u8; N], ) -> Result<(), ZByteIoError>
Sourceยงfn flush_bytes(&mut self) -> Result<(), ZByteIoError>
fn flush_bytes(&mut self) -> Result<(), ZByteIoError>
Sourceยงfn reserve_capacity(&mut self, _: usize) -> Result<(), ZByteIoError>
fn reserve_capacity(&mut self, _: usize) -> Result<(), ZByteIoError>
Vec can use this to reserve additional memory to
prevent reallocation when encoding Read more