Struct simple_bytes::Cursor
source · [−]pub struct Cursor<T> { /* private fields */ }
Expand description
A generic struct implementing BytesRead, BytesWrite and BytesSeek for different types.
In the background Bytes, BytesMut and BytesOwned use this.
Implementations
Trait Implementations
sourceimpl<T> BytesRead for Cursor<T> where
T: AsRef<[u8]>,
impl<T> BytesRead for Cursor<T> where
T: AsRef<[u8]>,
sourcefn as_slice(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
fn as_slice(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns the entire slice.
sourcefn remaining(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
fn remaining(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns all remaining bytes.
sourcefn try_read(&mut self, len: usize) -> Result<&[u8], ReadError>
fn try_read(&mut self, len: usize) -> Result<&[u8], ReadError>
Try to read a given length of bytes. Read more
sourcefn peek(&self, len: usize) -> Option<&[u8]>
fn peek(&self, len: usize) -> Option<&[u8]>
Tries to read a given length without updating
the internal position. Returns None
if there are not enought
bytes remaining. Read more
sourcefn read(&mut self, len: usize) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
fn read(&mut self, len: usize) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Reads a given length of bytes. Read more
sourcefn try_read_u8(&mut self) -> Result<u8, ReadError>
fn try_read_u8(&mut self) -> Result<u8, ReadError>
Try to read
1
bytes in big-endian converting them into an u8
. Read more
sourcefn try_read_u16(&mut self) -> Result<u16, ReadError>
fn try_read_u16(&mut self) -> Result<u16, ReadError>
Try to read
2
bytes in big-endian converting them into an u16
. Read more
sourcefn read_u16(&mut self) -> u16
fn read_u16(&mut self) -> u16
Reads
2
bytes in big-endian converting them into an u16
. Read more
sourcefn try_read_u32(&mut self) -> Result<u32, ReadError>
fn try_read_u32(&mut self) -> Result<u32, ReadError>
Try to read
4
bytes in big-endian converting them into an u32
. Read more
sourcefn read_u32(&mut self) -> u32
fn read_u32(&mut self) -> u32
Reads
4
bytes in big-endian converting them into an u32
. Read more
sourcefn try_read_u64(&mut self) -> Result<u64, ReadError>
fn try_read_u64(&mut self) -> Result<u64, ReadError>
Try to read
8
bytes in big-endian converting them into an u64
. Read more
sourcefn read_u64(&mut self) -> u64
fn read_u64(&mut self) -> u64
Reads
8
bytes in big-endian converting them into an u64
. Read more
sourcefn try_read_u128(&mut self) -> Result<u128, ReadError>
fn try_read_u128(&mut self) -> Result<u128, ReadError>
Try to read
16
bytes in big-endian converting them into an u128
. Read more
sourcefn read_u128(&mut self) -> u128
fn read_u128(&mut self) -> u128
Reads
16
bytes in big-endian converting them into an u128
. Read more
sourcefn try_read_i8(&mut self) -> Result<i8, ReadError>
fn try_read_i8(&mut self) -> Result<i8, ReadError>
Try to read
1
bytes in big-endian converting them into an i8
. Read more
sourcefn try_read_i16(&mut self) -> Result<i16, ReadError>
fn try_read_i16(&mut self) -> Result<i16, ReadError>
Try to read
2
bytes in big-endian converting them into an i16
. Read more
sourcefn read_i16(&mut self) -> i16
fn read_i16(&mut self) -> i16
Reads
2
bytes in big-endian converting them into an i16
. Read more
sourcefn try_read_i32(&mut self) -> Result<i32, ReadError>
fn try_read_i32(&mut self) -> Result<i32, ReadError>
Try to read
4
bytes in big-endian converting them into an i32
. Read more
sourcefn read_i32(&mut self) -> i32
fn read_i32(&mut self) -> i32
Reads
4
bytes in big-endian converting them into an i32
. Read more
sourcefn try_read_i64(&mut self) -> Result<i64, ReadError>
fn try_read_i64(&mut self) -> Result<i64, ReadError>
Try to read
8
bytes in big-endian converting them into an i64
. Read more
sourcefn read_i64(&mut self) -> i64
fn read_i64(&mut self) -> i64
Reads
8
bytes in big-endian converting them into an i64
. Read more
sourcefn try_read_i128(&mut self) -> Result<i128, ReadError>
fn try_read_i128(&mut self) -> Result<i128, ReadError>
Try to read
16
bytes in big-endian converting them into an i128
. Read more
sourcefn read_i128(&mut self) -> i128
fn read_i128(&mut self) -> i128
Reads
16
bytes in big-endian converting them into an i128
. Read more
sourcefn try_read_f32(&mut self) -> Result<f32, ReadError>
fn try_read_f32(&mut self) -> Result<f32, ReadError>
Try to read
4
bytes in big-endian converting them into an f32
. Read more
sourcefn read_f32(&mut self) -> f32
fn read_f32(&mut self) -> f32
Reads
4
bytes in big-endian converting them into an f32
. Read more
sourcefn try_read_f64(&mut self) -> Result<f64, ReadError>
fn try_read_f64(&mut self) -> Result<f64, ReadError>
Try to read
8
bytes in big-endian converting them into an f64
. Read more
sourcefn read_f64(&mut self) -> f64
fn read_f64(&mut self) -> f64
Reads
8
bytes in big-endian converting them into an f64
. Read more
sourcefn try_read_le_u8(&mut self) -> Result<u8, ReadError>
fn try_read_le_u8(&mut self) -> Result<u8, ReadError>
Try to read
1
bytes in little-endian converting them into an u8
. Read more
sourcefn read_le_u8(&mut self) -> u8
fn read_le_u8(&mut self) -> u8
Reads
1
bytes in little-endian converting them into an u8
. Read more
sourcefn try_read_le_u16(&mut self) -> Result<u16, ReadError>
fn try_read_le_u16(&mut self) -> Result<u16, ReadError>
Try to read
2
bytes in little-endian converting them into an u16
. Read more
sourcefn read_le_u16(&mut self) -> u16
fn read_le_u16(&mut self) -> u16
Reads
2
bytes in little-endian converting them into an u16
. Read more
sourcefn try_read_le_u32(&mut self) -> Result<u32, ReadError>
fn try_read_le_u32(&mut self) -> Result<u32, ReadError>
Try to read
4
bytes in little-endian converting them into an u32
. Read more
sourcefn read_le_u32(&mut self) -> u32
fn read_le_u32(&mut self) -> u32
Reads
4
bytes in little-endian converting them into an u32
. Read more
sourcefn try_read_le_u64(&mut self) -> Result<u64, ReadError>
fn try_read_le_u64(&mut self) -> Result<u64, ReadError>
Try to read
8
bytes in little-endian converting them into an u64
. Read more
sourcefn read_le_u64(&mut self) -> u64
fn read_le_u64(&mut self) -> u64
Reads
8
bytes in little-endian converting them into an u64
. Read more
sourcefn try_read_le_u128(&mut self) -> Result<u128, ReadError>
fn try_read_le_u128(&mut self) -> Result<u128, ReadError>
Try to read
16
bytes in little-endian converting them into an u128
. Read more
sourcefn read_le_u128(&mut self) -> u128
fn read_le_u128(&mut self) -> u128
Reads
16
bytes in little-endian converting them into an u128
. Read more
sourcefn try_read_le_i8(&mut self) -> Result<i8, ReadError>
fn try_read_le_i8(&mut self) -> Result<i8, ReadError>
Try to read
1
bytes in little-endian converting them into an i8
. Read more
sourcefn read_le_i8(&mut self) -> i8
fn read_le_i8(&mut self) -> i8
Reads
1
bytes in little-endian converting them into an i8
. Read more
sourcefn try_read_le_i16(&mut self) -> Result<i16, ReadError>
fn try_read_le_i16(&mut self) -> Result<i16, ReadError>
Try to read
2
bytes in little-endian converting them into an i16
. Read more
sourcefn read_le_i16(&mut self) -> i16
fn read_le_i16(&mut self) -> i16
Reads
2
bytes in little-endian converting them into an i16
. Read more
sourcefn try_read_le_i32(&mut self) -> Result<i32, ReadError>
fn try_read_le_i32(&mut self) -> Result<i32, ReadError>
Try to read
4
bytes in little-endian converting them into an i32
. Read more
sourcefn read_le_i32(&mut self) -> i32
fn read_le_i32(&mut self) -> i32
Reads
4
bytes in little-endian converting them into an i32
. Read more
sourcefn try_read_le_i64(&mut self) -> Result<i64, ReadError>
fn try_read_le_i64(&mut self) -> Result<i64, ReadError>
Try to read
8
bytes in little-endian converting them into an i64
. Read more
sourcefn read_le_i64(&mut self) -> i64
fn read_le_i64(&mut self) -> i64
Reads
8
bytes in little-endian converting them into an i64
. Read more
sourcefn try_read_le_i128(&mut self) -> Result<i128, ReadError>
fn try_read_le_i128(&mut self) -> Result<i128, ReadError>
Try to read
16
bytes in little-endian converting them into an i128
. Read more
sourcefn read_le_i128(&mut self) -> i128
fn read_le_i128(&mut self) -> i128
Reads
16
bytes in little-endian converting them into an i128
. Read more
sourcefn try_read_le_f32(&mut self) -> Result<f32, ReadError>
fn try_read_le_f32(&mut self) -> Result<f32, ReadError>
Try to read
4
bytes in little-endian converting them into an f32
. Read more
sourcefn read_le_f32(&mut self) -> f32
fn read_le_f32(&mut self) -> f32
Reads
4
bytes in little-endian converting them into an f32
. Read more
sourcefn try_read_le_f64(&mut self) -> Result<f64, ReadError>
fn try_read_le_f64(&mut self) -> Result<f64, ReadError>
Try to read
8
bytes in little-endian converting them into an f64
. Read more
sourcefn read_le_f64(&mut self) -> f64
fn read_le_f64(&mut self) -> f64
Reads
8
bytes in little-endian converting them into an f64
. Read more
sourceimpl<'a> BytesSeek for Cursor<&'a [u8]>
impl<'a> BytesSeek for Cursor<&'a [u8]>
sourceimpl<'a> BytesSeek for Cursor<&'a mut [u8]>
impl<'a> BytesSeek for Cursor<&'a mut [u8]>
sourceimpl<const L: usize> BytesSeek for Cursor<[u8; L]>
impl<const L: usize> BytesSeek for Cursor<[u8; L]>
sourceimpl BytesSeek for Cursor<&mut Vec<u8>>
impl BytesSeek for Cursor<&mut Vec<u8>>
sourceimpl BytesSeek for Cursor<Vec<u8>>
impl BytesSeek for Cursor<Vec<u8>>
sourceimpl<'a> BytesWrite for Cursor<&'a mut [u8]>
impl<'a> BytesWrite for Cursor<&'a mut [u8]>
sourcefn as_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
fn as_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns the entire slice mutably.
sourcefn as_bytes(&self) -> Bytes<'_>ⓘNotable traits for Bytes<'_>impl Read for Bytes<'_>
fn as_bytes(&self) -> Bytes<'_>ⓘNotable traits for Bytes<'_>impl Read for Bytes<'_>
Returns the entire slice as a bytes struct
setting the position of the new Bytes to 0
. Read more
sourcefn remaining_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
fn remaining_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns the remaining bytes mutably.
sourcefn try_write_u8(&mut self, num: u8) -> Result<(), WriteError>
fn try_write_u8(&mut self, num: u8) -> Result<(), WriteError>
Try to write u8 in big-endian.` Read more
sourcefn try_write_u16(&mut self, num: u16) -> Result<(), WriteError>
fn try_write_u16(&mut self, num: u16) -> Result<(), WriteError>
Try to write u16 in big-endian.` Read more
sourcefn try_write_u32(&mut self, num: u32) -> Result<(), WriteError>
fn try_write_u32(&mut self, num: u32) -> Result<(), WriteError>
Try to write u32 in big-endian.` Read more
sourcefn try_write_u64(&mut self, num: u64) -> Result<(), WriteError>
fn try_write_u64(&mut self, num: u64) -> Result<(), WriteError>
Try to write u64 in big-endian.` Read more
sourcefn try_write_u128(&mut self, num: u128) -> Result<(), WriteError>
fn try_write_u128(&mut self, num: u128) -> Result<(), WriteError>
Try to write u128 in big-endian.` Read more
sourcefn write_u128(&mut self, num: u128)
fn write_u128(&mut self, num: u128)
Writes an u128
in big-endian. Read more
sourcefn try_write_i8(&mut self, num: i8) -> Result<(), WriteError>
fn try_write_i8(&mut self, num: i8) -> Result<(), WriteError>
Try to write i8 in big-endian.` Read more
sourcefn try_write_i16(&mut self, num: i16) -> Result<(), WriteError>
fn try_write_i16(&mut self, num: i16) -> Result<(), WriteError>
Try to write i16 in big-endian.` Read more
sourcefn try_write_i32(&mut self, num: i32) -> Result<(), WriteError>
fn try_write_i32(&mut self, num: i32) -> Result<(), WriteError>
Try to write i32 in big-endian.` Read more
sourcefn try_write_i64(&mut self, num: i64) -> Result<(), WriteError>
fn try_write_i64(&mut self, num: i64) -> Result<(), WriteError>
Try to write i64 in big-endian.` Read more
sourcefn try_write_i128(&mut self, num: i128) -> Result<(), WriteError>
fn try_write_i128(&mut self, num: i128) -> Result<(), WriteError>
Try to write i128 in big-endian.` Read more
sourcefn write_i128(&mut self, num: i128)
fn write_i128(&mut self, num: i128)
Writes an i128
in big-endian. Read more
sourcefn try_write_f32(&mut self, num: f32) -> Result<(), WriteError>
fn try_write_f32(&mut self, num: f32) -> Result<(), WriteError>
Try to write f32 in big-endian.` Read more
sourcefn try_write_f64(&mut self, num: f64) -> Result<(), WriteError>
fn try_write_f64(&mut self, num: f64) -> Result<(), WriteError>
Try to write f64 in big-endian.` Read more
sourcefn try_write_le_u8(&mut self, num: u8) -> Result<(), WriteError>
fn try_write_le_u8(&mut self, num: u8) -> Result<(), WriteError>
Try to write u8 in little-endian.` Read more
sourcefn write_le_u8(&mut self, num: u8)
fn write_le_u8(&mut self, num: u8)
Writes an u8
in little-endian. Read more
sourcefn try_write_le_u16(&mut self, num: u16) -> Result<(), WriteError>
fn try_write_le_u16(&mut self, num: u16) -> Result<(), WriteError>
Try to write u16 in little-endian.` Read more
sourcefn write_le_u16(&mut self, num: u16)
fn write_le_u16(&mut self, num: u16)
Writes an u16
in little-endian. Read more
sourcefn try_write_le_u32(&mut self, num: u32) -> Result<(), WriteError>
fn try_write_le_u32(&mut self, num: u32) -> Result<(), WriteError>
Try to write u32 in little-endian.` Read more
sourcefn write_le_u32(&mut self, num: u32)
fn write_le_u32(&mut self, num: u32)
Writes an u32
in little-endian. Read more
sourcefn try_write_le_u64(&mut self, num: u64) -> Result<(), WriteError>
fn try_write_le_u64(&mut self, num: u64) -> Result<(), WriteError>
Try to write u64 in little-endian.` Read more
sourcefn write_le_u64(&mut self, num: u64)
fn write_le_u64(&mut self, num: u64)
Writes an u64
in little-endian. Read more
sourcefn try_write_le_u128(&mut self, num: u128) -> Result<(), WriteError>
fn try_write_le_u128(&mut self, num: u128) -> Result<(), WriteError>
Try to write u128 in little-endian.` Read more
sourcefn write_le_u128(&mut self, num: u128)
fn write_le_u128(&mut self, num: u128)
Writes an u128
in little-endian. Read more
sourcefn try_write_le_i8(&mut self, num: i8) -> Result<(), WriteError>
fn try_write_le_i8(&mut self, num: i8) -> Result<(), WriteError>
Try to write i8 in little-endian.` Read more
sourcefn write_le_i8(&mut self, num: i8)
fn write_le_i8(&mut self, num: i8)
Writes an i8
in little-endian. Read more
sourcefn try_write_le_i16(&mut self, num: i16) -> Result<(), WriteError>
fn try_write_le_i16(&mut self, num: i16) -> Result<(), WriteError>
Try to write i16 in little-endian.` Read more
sourcefn write_le_i16(&mut self, num: i16)
fn write_le_i16(&mut self, num: i16)
Writes an i16
in little-endian. Read more
sourcefn try_write_le_i32(&mut self, num: i32) -> Result<(), WriteError>
fn try_write_le_i32(&mut self, num: i32) -> Result<(), WriteError>
Try to write i32 in little-endian.` Read more
sourcefn write_le_i32(&mut self, num: i32)
fn write_le_i32(&mut self, num: i32)
Writes an i32
in little-endian. Read more
sourcefn try_write_le_i64(&mut self, num: i64) -> Result<(), WriteError>
fn try_write_le_i64(&mut self, num: i64) -> Result<(), WriteError>
Try to write i64 in little-endian.` Read more
sourcefn write_le_i64(&mut self, num: i64)
fn write_le_i64(&mut self, num: i64)
Writes an i64
in little-endian. Read more
sourcefn try_write_le_i128(&mut self, num: i128) -> Result<(), WriteError>
fn try_write_le_i128(&mut self, num: i128) -> Result<(), WriteError>
Try to write i128 in little-endian.` Read more
sourcefn write_le_i128(&mut self, num: i128)
fn write_le_i128(&mut self, num: i128)
Writes an i128
in little-endian. Read more
sourcefn try_write_le_f32(&mut self, num: f32) -> Result<(), WriteError>
fn try_write_le_f32(&mut self, num: f32) -> Result<(), WriteError>
Try to write f32 in little-endian.` Read more
sourcefn write_le_f32(&mut self, num: f32)
fn write_le_f32(&mut self, num: f32)
Writes an f32
in little-endian. Read more
sourcefn try_write_le_f64(&mut self, num: f64) -> Result<(), WriteError>
fn try_write_le_f64(&mut self, num: f64) -> Result<(), WriteError>
Try to write f64 in little-endian.` Read more
sourcefn write_le_f64(&mut self, num: f64)
fn write_le_f64(&mut self, num: f64)
Writes an f64
in little-endian. Read more
sourceimpl<const L: usize> BytesWrite for Cursor<[u8; L]>
impl<const L: usize> BytesWrite for Cursor<[u8; L]>
sourcefn as_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
fn as_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns the entire slice mutably.
sourcefn as_bytes(&self) -> Bytes<'_>ⓘNotable traits for Bytes<'_>impl Read for Bytes<'_>
fn as_bytes(&self) -> Bytes<'_>ⓘNotable traits for Bytes<'_>impl Read for Bytes<'_>
Returns the entire slice as a bytes struct
setting the position of the new Bytes to 0
. Read more
sourcefn remaining_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
fn remaining_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns the remaining bytes mutably.
sourcefn try_write_u8(&mut self, num: u8) -> Result<(), WriteError>
fn try_write_u8(&mut self, num: u8) -> Result<(), WriteError>
Try to write u8 in big-endian.` Read more
sourcefn try_write_u16(&mut self, num: u16) -> Result<(), WriteError>
fn try_write_u16(&mut self, num: u16) -> Result<(), WriteError>
Try to write u16 in big-endian.` Read more
sourcefn try_write_u32(&mut self, num: u32) -> Result<(), WriteError>
fn try_write_u32(&mut self, num: u32) -> Result<(), WriteError>
Try to write u32 in big-endian.` Read more
sourcefn try_write_u64(&mut self, num: u64) -> Result<(), WriteError>
fn try_write_u64(&mut self, num: u64) -> Result<(), WriteError>
Try to write u64 in big-endian.` Read more
sourcefn try_write_u128(&mut self, num: u128) -> Result<(), WriteError>
fn try_write_u128(&mut self, num: u128) -> Result<(), WriteError>
Try to write u128 in big-endian.` Read more
sourcefn write_u128(&mut self, num: u128)
fn write_u128(&mut self, num: u128)
Writes an u128
in big-endian. Read more
sourcefn try_write_i8(&mut self, num: i8) -> Result<(), WriteError>
fn try_write_i8(&mut self, num: i8) -> Result<(), WriteError>
Try to write i8 in big-endian.` Read more
sourcefn try_write_i16(&mut self, num: i16) -> Result<(), WriteError>
fn try_write_i16(&mut self, num: i16) -> Result<(), WriteError>
Try to write i16 in big-endian.` Read more
sourcefn try_write_i32(&mut self, num: i32) -> Result<(), WriteError>
fn try_write_i32(&mut self, num: i32) -> Result<(), WriteError>
Try to write i32 in big-endian.` Read more
sourcefn try_write_i64(&mut self, num: i64) -> Result<(), WriteError>
fn try_write_i64(&mut self, num: i64) -> Result<(), WriteError>
Try to write i64 in big-endian.` Read more
sourcefn try_write_i128(&mut self, num: i128) -> Result<(), WriteError>
fn try_write_i128(&mut self, num: i128) -> Result<(), WriteError>
Try to write i128 in big-endian.` Read more
sourcefn write_i128(&mut self, num: i128)
fn write_i128(&mut self, num: i128)
Writes an i128
in big-endian. Read more
sourcefn try_write_f32(&mut self, num: f32) -> Result<(), WriteError>
fn try_write_f32(&mut self, num: f32) -> Result<(), WriteError>
Try to write f32 in big-endian.` Read more
sourcefn try_write_f64(&mut self, num: f64) -> Result<(), WriteError>
fn try_write_f64(&mut self, num: f64) -> Result<(), WriteError>
Try to write f64 in big-endian.` Read more
sourcefn try_write_le_u8(&mut self, num: u8) -> Result<(), WriteError>
fn try_write_le_u8(&mut self, num: u8) -> Result<(), WriteError>
Try to write u8 in little-endian.` Read more
sourcefn write_le_u8(&mut self, num: u8)
fn write_le_u8(&mut self, num: u8)
Writes an u8
in little-endian. Read more
sourcefn try_write_le_u16(&mut self, num: u16) -> Result<(), WriteError>
fn try_write_le_u16(&mut self, num: u16) -> Result<(), WriteError>
Try to write u16 in little-endian.` Read more
sourcefn write_le_u16(&mut self, num: u16)
fn write_le_u16(&mut self, num: u16)
Writes an u16
in little-endian. Read more
sourcefn try_write_le_u32(&mut self, num: u32) -> Result<(), WriteError>
fn try_write_le_u32(&mut self, num: u32) -> Result<(), WriteError>
Try to write u32 in little-endian.` Read more
sourcefn write_le_u32(&mut self, num: u32)
fn write_le_u32(&mut self, num: u32)
Writes an u32
in little-endian. Read more
sourcefn try_write_le_u64(&mut self, num: u64) -> Result<(), WriteError>
fn try_write_le_u64(&mut self, num: u64) -> Result<(), WriteError>
Try to write u64 in little-endian.` Read more
sourcefn write_le_u64(&mut self, num: u64)
fn write_le_u64(&mut self, num: u64)
Writes an u64
in little-endian. Read more
sourcefn try_write_le_u128(&mut self, num: u128) -> Result<(), WriteError>
fn try_write_le_u128(&mut self, num: u128) -> Result<(), WriteError>
Try to write u128 in little-endian.` Read more
sourcefn write_le_u128(&mut self, num: u128)
fn write_le_u128(&mut self, num: u128)
Writes an u128
in little-endian. Read more
sourcefn try_write_le_i8(&mut self, num: i8) -> Result<(), WriteError>
fn try_write_le_i8(&mut self, num: i8) -> Result<(), WriteError>
Try to write i8 in little-endian.` Read more
sourcefn write_le_i8(&mut self, num: i8)
fn write_le_i8(&mut self, num: i8)
Writes an i8
in little-endian. Read more
sourcefn try_write_le_i16(&mut self, num: i16) -> Result<(), WriteError>
fn try_write_le_i16(&mut self, num: i16) -> Result<(), WriteError>
Try to write i16 in little-endian.` Read more
sourcefn write_le_i16(&mut self, num: i16)
fn write_le_i16(&mut self, num: i16)
Writes an i16
in little-endian. Read more
sourcefn try_write_le_i32(&mut self, num: i32) -> Result<(), WriteError>
fn try_write_le_i32(&mut self, num: i32) -> Result<(), WriteError>
Try to write i32 in little-endian.` Read more
sourcefn write_le_i32(&mut self, num: i32)
fn write_le_i32(&mut self, num: i32)
Writes an i32
in little-endian. Read more
sourcefn try_write_le_i64(&mut self, num: i64) -> Result<(), WriteError>
fn try_write_le_i64(&mut self, num: i64) -> Result<(), WriteError>
Try to write i64 in little-endian.` Read more
sourcefn write_le_i64(&mut self, num: i64)
fn write_le_i64(&mut self, num: i64)
Writes an i64
in little-endian. Read more
sourcefn try_write_le_i128(&mut self, num: i128) -> Result<(), WriteError>
fn try_write_le_i128(&mut self, num: i128) -> Result<(), WriteError>
Try to write i128 in little-endian.` Read more
sourcefn write_le_i128(&mut self, num: i128)
fn write_le_i128(&mut self, num: i128)
Writes an i128
in little-endian. Read more
sourcefn try_write_le_f32(&mut self, num: f32) -> Result<(), WriteError>
fn try_write_le_f32(&mut self, num: f32) -> Result<(), WriteError>
Try to write f32 in little-endian.` Read more
sourcefn write_le_f32(&mut self, num: f32)
fn write_le_f32(&mut self, num: f32)
Writes an f32
in little-endian. Read more
sourcefn try_write_le_f64(&mut self, num: f64) -> Result<(), WriteError>
fn try_write_le_f64(&mut self, num: f64) -> Result<(), WriteError>
Try to write f64 in little-endian.` Read more
sourcefn write_le_f64(&mut self, num: f64)
fn write_le_f64(&mut self, num: f64)
Writes an f64
in little-endian. Read more
sourceimpl BytesWrite for Cursor<&mut Vec<u8>>
impl BytesWrite for Cursor<&mut Vec<u8>>
sourcefn remaining_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
fn remaining_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns the remaining mutable slice.
If an empty slice is returned, this does not mean you can’t write anymore.
sourcefn try_write(&mut self, slice: impl AsRef<[u8]>) -> Result<(), WriteError>
fn try_write(&mut self, slice: impl AsRef<[u8]>) -> Result<(), WriteError>
Write a slice. Allocates more space if the slice is
bigger than the Vec
.
sourcefn as_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
fn as_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns the entire slice mutably.
sourcefn as_bytes(&self) -> Bytes<'_>ⓘNotable traits for Bytes<'_>impl Read for Bytes<'_>
fn as_bytes(&self) -> Bytes<'_>ⓘNotable traits for Bytes<'_>impl Read for Bytes<'_>
Returns the entire slice as a bytes struct
setting the position of the new Bytes to 0
. Read more
sourcefn try_write_u8(&mut self, num: u8) -> Result<(), WriteError>
fn try_write_u8(&mut self, num: u8) -> Result<(), WriteError>
Try to write u8 in big-endian.` Read more
sourcefn try_write_u16(&mut self, num: u16) -> Result<(), WriteError>
fn try_write_u16(&mut self, num: u16) -> Result<(), WriteError>
Try to write u16 in big-endian.` Read more
sourcefn try_write_u32(&mut self, num: u32) -> Result<(), WriteError>
fn try_write_u32(&mut self, num: u32) -> Result<(), WriteError>
Try to write u32 in big-endian.` Read more
sourcefn try_write_u64(&mut self, num: u64) -> Result<(), WriteError>
fn try_write_u64(&mut self, num: u64) -> Result<(), WriteError>
Try to write u64 in big-endian.` Read more
sourcefn try_write_u128(&mut self, num: u128) -> Result<(), WriteError>
fn try_write_u128(&mut self, num: u128) -> Result<(), WriteError>
Try to write u128 in big-endian.` Read more
sourcefn write_u128(&mut self, num: u128)
fn write_u128(&mut self, num: u128)
Writes an u128
in big-endian. Read more
sourcefn try_write_i8(&mut self, num: i8) -> Result<(), WriteError>
fn try_write_i8(&mut self, num: i8) -> Result<(), WriteError>
Try to write i8 in big-endian.` Read more
sourcefn try_write_i16(&mut self, num: i16) -> Result<(), WriteError>
fn try_write_i16(&mut self, num: i16) -> Result<(), WriteError>
Try to write i16 in big-endian.` Read more
sourcefn try_write_i32(&mut self, num: i32) -> Result<(), WriteError>
fn try_write_i32(&mut self, num: i32) -> Result<(), WriteError>
Try to write i32 in big-endian.` Read more
sourcefn try_write_i64(&mut self, num: i64) -> Result<(), WriteError>
fn try_write_i64(&mut self, num: i64) -> Result<(), WriteError>
Try to write i64 in big-endian.` Read more
sourcefn try_write_i128(&mut self, num: i128) -> Result<(), WriteError>
fn try_write_i128(&mut self, num: i128) -> Result<(), WriteError>
Try to write i128 in big-endian.` Read more
sourcefn write_i128(&mut self, num: i128)
fn write_i128(&mut self, num: i128)
Writes an i128
in big-endian. Read more
sourcefn try_write_f32(&mut self, num: f32) -> Result<(), WriteError>
fn try_write_f32(&mut self, num: f32) -> Result<(), WriteError>
Try to write f32 in big-endian.` Read more
sourcefn try_write_f64(&mut self, num: f64) -> Result<(), WriteError>
fn try_write_f64(&mut self, num: f64) -> Result<(), WriteError>
Try to write f64 in big-endian.` Read more
sourcefn try_write_le_u8(&mut self, num: u8) -> Result<(), WriteError>
fn try_write_le_u8(&mut self, num: u8) -> Result<(), WriteError>
Try to write u8 in little-endian.` Read more
sourcefn write_le_u8(&mut self, num: u8)
fn write_le_u8(&mut self, num: u8)
Writes an u8
in little-endian. Read more
sourcefn try_write_le_u16(&mut self, num: u16) -> Result<(), WriteError>
fn try_write_le_u16(&mut self, num: u16) -> Result<(), WriteError>
Try to write u16 in little-endian.` Read more
sourcefn write_le_u16(&mut self, num: u16)
fn write_le_u16(&mut self, num: u16)
Writes an u16
in little-endian. Read more
sourcefn try_write_le_u32(&mut self, num: u32) -> Result<(), WriteError>
fn try_write_le_u32(&mut self, num: u32) -> Result<(), WriteError>
Try to write u32 in little-endian.` Read more
sourcefn write_le_u32(&mut self, num: u32)
fn write_le_u32(&mut self, num: u32)
Writes an u32
in little-endian. Read more
sourcefn try_write_le_u64(&mut self, num: u64) -> Result<(), WriteError>
fn try_write_le_u64(&mut self, num: u64) -> Result<(), WriteError>
Try to write u64 in little-endian.` Read more
sourcefn write_le_u64(&mut self, num: u64)
fn write_le_u64(&mut self, num: u64)
Writes an u64
in little-endian. Read more
sourcefn try_write_le_u128(&mut self, num: u128) -> Result<(), WriteError>
fn try_write_le_u128(&mut self, num: u128) -> Result<(), WriteError>
Try to write u128 in little-endian.` Read more
sourcefn write_le_u128(&mut self, num: u128)
fn write_le_u128(&mut self, num: u128)
Writes an u128
in little-endian. Read more
sourcefn try_write_le_i8(&mut self, num: i8) -> Result<(), WriteError>
fn try_write_le_i8(&mut self, num: i8) -> Result<(), WriteError>
Try to write i8 in little-endian.` Read more
sourcefn write_le_i8(&mut self, num: i8)
fn write_le_i8(&mut self, num: i8)
Writes an i8
in little-endian. Read more
sourcefn try_write_le_i16(&mut self, num: i16) -> Result<(), WriteError>
fn try_write_le_i16(&mut self, num: i16) -> Result<(), WriteError>
Try to write i16 in little-endian.` Read more
sourcefn write_le_i16(&mut self, num: i16)
fn write_le_i16(&mut self, num: i16)
Writes an i16
in little-endian. Read more
sourcefn try_write_le_i32(&mut self, num: i32) -> Result<(), WriteError>
fn try_write_le_i32(&mut self, num: i32) -> Result<(), WriteError>
Try to write i32 in little-endian.` Read more
sourcefn write_le_i32(&mut self, num: i32)
fn write_le_i32(&mut self, num: i32)
Writes an i32
in little-endian. Read more
sourcefn try_write_le_i64(&mut self, num: i64) -> Result<(), WriteError>
fn try_write_le_i64(&mut self, num: i64) -> Result<(), WriteError>
Try to write i64 in little-endian.` Read more
sourcefn write_le_i64(&mut self, num: i64)
fn write_le_i64(&mut self, num: i64)
Writes an i64
in little-endian. Read more
sourcefn try_write_le_i128(&mut self, num: i128) -> Result<(), WriteError>
fn try_write_le_i128(&mut self, num: i128) -> Result<(), WriteError>
Try to write i128 in little-endian.` Read more
sourcefn write_le_i128(&mut self, num: i128)
fn write_le_i128(&mut self, num: i128)
Writes an i128
in little-endian. Read more
sourcefn try_write_le_f32(&mut self, num: f32) -> Result<(), WriteError>
fn try_write_le_f32(&mut self, num: f32) -> Result<(), WriteError>
Try to write f32 in little-endian.` Read more
sourcefn write_le_f32(&mut self, num: f32)
fn write_le_f32(&mut self, num: f32)
Writes an f32
in little-endian. Read more
sourcefn try_write_le_f64(&mut self, num: f64) -> Result<(), WriteError>
fn try_write_le_f64(&mut self, num: f64) -> Result<(), WriteError>
Try to write f64 in little-endian.` Read more
sourcefn write_le_f64(&mut self, num: f64)
fn write_le_f64(&mut self, num: f64)
Writes an f64
in little-endian. Read more
sourceimpl BytesWrite for Cursor<Vec<u8>>
impl BytesWrite for Cursor<Vec<u8>>
sourcefn remaining_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
fn remaining_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns the remaining mutable slice.
If an empty slice is returned, this does not mean you can’t write anymore.
sourcefn try_write(&mut self, slice: impl AsRef<[u8]>) -> Result<(), WriteError>
fn try_write(&mut self, slice: impl AsRef<[u8]>) -> Result<(), WriteError>
Write a slice. Allocates more space if the slice is
bigger than the Vec
.
sourcefn as_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
fn as_mut(&mut self) -> &mut [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns the entire slice mutably.
sourcefn as_bytes(&self) -> Bytes<'_>ⓘNotable traits for Bytes<'_>impl Read for Bytes<'_>
fn as_bytes(&self) -> Bytes<'_>ⓘNotable traits for Bytes<'_>impl Read for Bytes<'_>
Returns the entire slice as a bytes struct
setting the position of the new Bytes to 0
. Read more
sourcefn try_write_u8(&mut self, num: u8) -> Result<(), WriteError>
fn try_write_u8(&mut self, num: u8) -> Result<(), WriteError>
Try to write u8 in big-endian.` Read more
sourcefn try_write_u16(&mut self, num: u16) -> Result<(), WriteError>
fn try_write_u16(&mut self, num: u16) -> Result<(), WriteError>
Try to write u16 in big-endian.` Read more
sourcefn try_write_u32(&mut self, num: u32) -> Result<(), WriteError>
fn try_write_u32(&mut self, num: u32) -> Result<(), WriteError>
Try to write u32 in big-endian.` Read more
sourcefn try_write_u64(&mut self, num: u64) -> Result<(), WriteError>
fn try_write_u64(&mut self, num: u64) -> Result<(), WriteError>
Try to write u64 in big-endian.` Read more
sourcefn try_write_u128(&mut self, num: u128) -> Result<(), WriteError>
fn try_write_u128(&mut self, num: u128) -> Result<(), WriteError>
Try to write u128 in big-endian.` Read more
sourcefn write_u128(&mut self, num: u128)
fn write_u128(&mut self, num: u128)
Writes an u128
in big-endian. Read more
sourcefn try_write_i8(&mut self, num: i8) -> Result<(), WriteError>
fn try_write_i8(&mut self, num: i8) -> Result<(), WriteError>
Try to write i8 in big-endian.` Read more
sourcefn try_write_i16(&mut self, num: i16) -> Result<(), WriteError>
fn try_write_i16(&mut self, num: i16) -> Result<(), WriteError>
Try to write i16 in big-endian.` Read more
sourcefn try_write_i32(&mut self, num: i32) -> Result<(), WriteError>
fn try_write_i32(&mut self, num: i32) -> Result<(), WriteError>
Try to write i32 in big-endian.` Read more
sourcefn try_write_i64(&mut self, num: i64) -> Result<(), WriteError>
fn try_write_i64(&mut self, num: i64) -> Result<(), WriteError>
Try to write i64 in big-endian.` Read more
sourcefn try_write_i128(&mut self, num: i128) -> Result<(), WriteError>
fn try_write_i128(&mut self, num: i128) -> Result<(), WriteError>
Try to write i128 in big-endian.` Read more
sourcefn write_i128(&mut self, num: i128)
fn write_i128(&mut self, num: i128)
Writes an i128
in big-endian. Read more
sourcefn try_write_f32(&mut self, num: f32) -> Result<(), WriteError>
fn try_write_f32(&mut self, num: f32) -> Result<(), WriteError>
Try to write f32 in big-endian.` Read more
sourcefn try_write_f64(&mut self, num: f64) -> Result<(), WriteError>
fn try_write_f64(&mut self, num: f64) -> Result<(), WriteError>
Try to write f64 in big-endian.` Read more
sourcefn try_write_le_u8(&mut self, num: u8) -> Result<(), WriteError>
fn try_write_le_u8(&mut self, num: u8) -> Result<(), WriteError>
Try to write u8 in little-endian.` Read more
sourcefn write_le_u8(&mut self, num: u8)
fn write_le_u8(&mut self, num: u8)
Writes an u8
in little-endian. Read more
sourcefn try_write_le_u16(&mut self, num: u16) -> Result<(), WriteError>
fn try_write_le_u16(&mut self, num: u16) -> Result<(), WriteError>
Try to write u16 in little-endian.` Read more
sourcefn write_le_u16(&mut self, num: u16)
fn write_le_u16(&mut self, num: u16)
Writes an u16
in little-endian. Read more
sourcefn try_write_le_u32(&mut self, num: u32) -> Result<(), WriteError>
fn try_write_le_u32(&mut self, num: u32) -> Result<(), WriteError>
Try to write u32 in little-endian.` Read more
sourcefn write_le_u32(&mut self, num: u32)
fn write_le_u32(&mut self, num: u32)
Writes an u32
in little-endian. Read more
sourcefn try_write_le_u64(&mut self, num: u64) -> Result<(), WriteError>
fn try_write_le_u64(&mut self, num: u64) -> Result<(), WriteError>
Try to write u64 in little-endian.` Read more
sourcefn write_le_u64(&mut self, num: u64)
fn write_le_u64(&mut self, num: u64)
Writes an u64
in little-endian. Read more
sourcefn try_write_le_u128(&mut self, num: u128) -> Result<(), WriteError>
fn try_write_le_u128(&mut self, num: u128) -> Result<(), WriteError>
Try to write u128 in little-endian.` Read more
sourcefn write_le_u128(&mut self, num: u128)
fn write_le_u128(&mut self, num: u128)
Writes an u128
in little-endian. Read more
sourcefn try_write_le_i8(&mut self, num: i8) -> Result<(), WriteError>
fn try_write_le_i8(&mut self, num: i8) -> Result<(), WriteError>
Try to write i8 in little-endian.` Read more
sourcefn write_le_i8(&mut self, num: i8)
fn write_le_i8(&mut self, num: i8)
Writes an i8
in little-endian. Read more
sourcefn try_write_le_i16(&mut self, num: i16) -> Result<(), WriteError>
fn try_write_le_i16(&mut self, num: i16) -> Result<(), WriteError>
Try to write i16 in little-endian.` Read more
sourcefn write_le_i16(&mut self, num: i16)
fn write_le_i16(&mut self, num: i16)
Writes an i16
in little-endian. Read more
sourcefn try_write_le_i32(&mut self, num: i32) -> Result<(), WriteError>
fn try_write_le_i32(&mut self, num: i32) -> Result<(), WriteError>
Try to write i32 in little-endian.` Read more
sourcefn write_le_i32(&mut self, num: i32)
fn write_le_i32(&mut self, num: i32)
Writes an i32
in little-endian. Read more
sourcefn try_write_le_i64(&mut self, num: i64) -> Result<(), WriteError>
fn try_write_le_i64(&mut self, num: i64) -> Result<(), WriteError>
Try to write i64 in little-endian.` Read more
sourcefn write_le_i64(&mut self, num: i64)
fn write_le_i64(&mut self, num: i64)
Writes an i64
in little-endian. Read more
sourcefn try_write_le_i128(&mut self, num: i128) -> Result<(), WriteError>
fn try_write_le_i128(&mut self, num: i128) -> Result<(), WriteError>
Try to write i128 in little-endian.` Read more
sourcefn write_le_i128(&mut self, num: i128)
fn write_le_i128(&mut self, num: i128)
Writes an i128
in little-endian. Read more
sourcefn try_write_le_f32(&mut self, num: f32) -> Result<(), WriteError>
fn try_write_le_f32(&mut self, num: f32) -> Result<(), WriteError>
Try to write f32 in little-endian.` Read more
sourcefn write_le_f32(&mut self, num: f32)
fn write_le_f32(&mut self, num: f32)
Writes an f32
in little-endian. Read more
sourcefn try_write_le_f64(&mut self, num: f64) -> Result<(), WriteError>
fn try_write_le_f64(&mut self, num: f64) -> Result<(), WriteError>
Try to write f64 in little-endian.` Read more
sourcefn write_le_f64(&mut self, num: f64)
fn write_le_f64(&mut self, num: f64)
Writes an f64
in little-endian. Read more
sourceimpl<T: Clone> Clone for Cursor<T>
impl<T: Clone> Clone for Cursor<T>
sourcefn clone(&self) -> Cursor<T>ⓘNotable traits for Cursor<T>impl<T> Read for Cursor<T> where
T: AsRef<[u8]>, impl<'a> Write for Cursor<&'a mut [u8]>impl<const L: usize> Write for Cursor<[u8; L]>impl Write for Cursor<&mut Vec<u8>>impl Write for Cursor<Vec<u8>>
fn clone(&self) -> Cursor<T>ⓘNotable traits for Cursor<T>impl<T> Read for Cursor<T> where
T: AsRef<[u8]>, impl<'a> Write for Cursor<&'a mut [u8]>impl<const L: usize> Write for Cursor<[u8; L]>impl Write for Cursor<&mut Vec<u8>>impl Write for Cursor<Vec<u8>>
T: AsRef<[u8]>, impl<'a> Write for Cursor<&'a mut [u8]>impl<const L: usize> Write for Cursor<[u8; L]>impl Write for Cursor<&mut Vec<u8>>impl Write for Cursor<Vec<u8>>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T> Read for Cursor<T> where
T: AsRef<[u8]>,
impl<T> Read for Cursor<T> where
T: AsRef<[u8]>,
sourcefn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
1.36.0 · sourcefn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
Like read
, except that it reads into a slice of buffers. Read more
sourcefn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
1.0.0 · sourcefn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
Read all bytes until EOF in this source, placing them into buf
. Read more
1.0.0 · sourcefn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
Read all bytes until EOF in this source, appending them to buf
. Read more
1.6.0 · sourcefn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
Read the exact number of bytes required to fill buf
. Read more
sourcefn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
read_buf
)Pull some bytes from this source into the specified buffer. Read more
sourcefn read_buf_exact(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
read_buf
)Read the exact number of bytes required to fill buf
. Read more
1.0.0 · sourcefn by_ref(&mut self) -> &mut Self
fn by_ref(&mut self) -> &mut Self
Creates a “by reference” adaptor for this instance of Read
. Read more
sourceimpl<'a> Seek for Cursor<&'a [u8]>
impl<'a> Seek for Cursor<&'a [u8]>
sourcefn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
Seek to an offset, in bytes, in a stream. Read more
1.55.0 · sourcefn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Rewind to the beginning of a stream. Read more
sourceimpl<'a> Seek for Cursor<&'a mut [u8]>
impl<'a> Seek for Cursor<&'a mut [u8]>
sourcefn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
Seek to an offset, in bytes, in a stream. Read more
1.55.0 · sourcefn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Rewind to the beginning of a stream. Read more
sourceimpl<const L: usize> Seek for Cursor<[u8; L]>
impl<const L: usize> Seek for Cursor<[u8; L]>
sourcefn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
Seek to an offset, in bytes, in a stream. Read more
1.55.0 · sourcefn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Rewind to the beginning of a stream. Read more
sourceimpl Seek for Cursor<&mut Vec<u8>>
impl Seek for Cursor<&mut Vec<u8>>
sourcefn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
Seek to an offset, in bytes, in a stream. Read more
1.55.0 · sourcefn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Rewind to the beginning of a stream. Read more
sourceimpl Seek for Cursor<Vec<u8>>
impl Seek for Cursor<Vec<u8>>
sourcefn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
Seek to an offset, in bytes, in a stream. Read more
1.55.0 · sourcefn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Rewind to the beginning of a stream. Read more
sourceimpl<'a> Write for Cursor<&'a mut [u8]>
impl<'a> Write for Cursor<&'a mut [u8]>
sourcefn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this writer, returning how many bytes were written. Read more
sourcefn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
1.0.0 · sourcefn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
sourcefn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
sourceimpl<const L: usize> Write for Cursor<[u8; L]>
impl<const L: usize> Write for Cursor<[u8; L]>
sourcefn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this writer, returning how many bytes were written. Read more
sourcefn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
1.0.0 · sourcefn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
sourcefn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
sourceimpl Write for Cursor<&mut Vec<u8>>
impl Write for Cursor<&mut Vec<u8>>
sourcefn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this writer, returning how many bytes were written. Read more
sourcefn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
1.0.0 · sourcefn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
sourcefn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
sourceimpl Write for Cursor<Vec<u8>>
impl Write for Cursor<Vec<u8>>
sourcefn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this writer, returning how many bytes were written. Read more
sourcefn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
1.0.0 · sourcefn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
sourcefn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
impl<T: Copy> Copy for Cursor<T>
impl<T: Eq> Eq for Cursor<T>
impl<T> StructuralEq for Cursor<T>
impl<T> StructuralPartialEq for Cursor<T>
Auto Trait Implementations
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> UnwindSafe for Cursor<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more