pub struct SyncFileBackend { /* private fields */ }Expand description
Synchronous file-backed BlockBackend — opens the host file once and
serializes I/O through a parking_lot::Mutex<File>. The mutex guard is
released before the device thread re-acquires its own state lock so the
bus is not blocked across host I/O.
The workspace disallowed-types lint pushes runtime I/O onto Tokio; the
sync engine is the explicit blocking-I/O alternative for low-IOPS
workloads (per 14-virtio-and-devices.md §
4.1) so the std::fs::File allow is
intentional. The async engine uses tokio::task::spawn_blocking and lives in a follow-up.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SyncFileBackend
impl !RefUnwindSafe for SyncFileBackend
impl Send for SyncFileBackend
impl Sync for SyncFileBackend
impl Unpin for SyncFileBackend
impl UnsafeUnpin for SyncFileBackend
impl UnwindSafe for SyncFileBackend
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