Struct ioat::AssertThreadSafe
[−]
[src]
pub struct AssertThreadSafe<T>(pub T);
A struct for wrapping thread-safe readers or writers.
Using this struct asserts, that the contained Read + Seek
or
Write + Seek
value can be used for ReadAt
and WriteAt
, without risking a seek from
another thread in parallel.
The traits are implemented by first seeking to the offset, and then calling the appropriate method on the wrapped value.
Trait Implementations
impl<T: Clone> Clone for AssertThreadSafe<T>
[src]
fn clone(&self) -> AssertThreadSafe<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for AssertThreadSafe<T>
[src]
impl<T> ReadAt for AssertThreadSafe<T> where
T: Read + Seek,
[src]
T: Read + Seek,
fn read_at(&mut self, pos: u64, buf: &mut [u8]) -> Result<usize>
Reads some bytes from pos
bytes into the source. Read more
fn read_exact_at(&mut self, pos: u64, buf: &mut [u8]) -> Result<()>
Reads exactly buf.len()
bytes from pos
bytes into the source. Read more
impl<T> WriteAt for AssertThreadSafe<T> where
T: Write + Seek,
[src]
T: Write + Seek,
fn write_at(&mut self, pos: u64, buf: &[u8]) -> Result<usize>
Writes some bytes at pos
bytes into self
. Read more
fn flush(&mut self) -> Result<()>
Flushes any pending writes to the underlying sink. Read more
fn write_all_at(&mut self, pos: u64, buf: &[u8]) -> Result<()>
Writes exactly buf.len()
bytes at pos
bytes into self
. Read more