pub struct ForceSyncSend<T>(/* private fields */);Expand description
Wrapper to share a block device behind Arc without adding locking.
§Safety
This type provides unsynchronized interior mutability. Only use it when all access is externally serialized (single-threaded execution or a higher-level mutex).
Implementations§
Source§impl<T> ForceSyncSend<T>
impl<T> ForceSyncSend<T>
Trait Implementations§
Source§impl<B: BlockDevice> BlockDevice for ForceSyncSend<B>
impl<B: BlockDevice> BlockDevice for ForceSyncSend<B>
Source§type Error = <B as BlockDevice>::Error
type Error = <B as BlockDevice>::Error
The errors that the
BlockDevice can return. Must be debug formattable.Source§fn read(
&self,
blocks: &mut [Block],
start: BlockIdx,
reason: &str,
) -> Result<(), Self::Error>
fn read( &self, blocks: &mut [Block], start: BlockIdx, reason: &str, ) -> Result<(), Self::Error>
Read one or more blocks, starting at the given block index.
Source§fn write(&self, blocks: &[Block], start: BlockIdx) -> Result<(), Self::Error>
fn write(&self, blocks: &[Block], start: BlockIdx) -> Result<(), Self::Error>
Write one or more blocks, starting at the given block index.
Source§fn num_blocks(&self) -> Result<BlockCount, Self::Error>
fn num_blocks(&self) -> Result<BlockCount, Self::Error>
Determine how many blocks this device can hold.
impl<T: Send> Send for ForceSyncSend<T>
impl<T: Send> Sync for ForceSyncSend<T>
Auto Trait Implementations§
impl<T> !Freeze for ForceSyncSend<T>
impl<T> !RefUnwindSafe for ForceSyncSend<T>
impl<T> Unpin for ForceSyncSend<T>where
T: Unpin,
impl<T> UnsafeUnpin for ForceSyncSend<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ForceSyncSend<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