pub struct AssertThreadSafe<T>(pub T);
Expand description
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.
Tuple Fields§
§0: T
Trait Implementations§
Source§impl<T: Clone> Clone for AssertThreadSafe<T>
impl<T: Clone> Clone for AssertThreadSafe<T>
Source§fn clone(&self) -> AssertThreadSafe<T>
fn clone(&self) -> AssertThreadSafe<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for AssertThreadSafe<T>
impl<T: Debug> Debug for AssertThreadSafe<T>
Source§impl<T> ReadAt for AssertThreadSafe<T>
impl<T> ReadAt for AssertThreadSafe<T>
Auto Trait Implementations§
impl<T> Freeze for AssertThreadSafe<T>where
T: Freeze,
impl<T> RefUnwindSafe for AssertThreadSafe<T>where
T: RefUnwindSafe,
impl<T> Send for AssertThreadSafe<T>where
T: Send,
impl<T> Sync for AssertThreadSafe<T>where
T: Sync,
impl<T> Unpin for AssertThreadSafe<T>where
T: Unpin,
impl<T> UnwindSafe for AssertThreadSafe<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
Mutably borrows from an owned value. Read more