pub struct MemoryDevice {
pub bytes: Vec<u8>,
pub label: String,
}Expand description
In-memory Device impl used by unit tests. Backed by a Vec<u8>.
Fields§
§bytes: Vec<u8>§label: StringImplementations§
Trait Implementations§
Source§impl Device for MemoryDevice
impl Device for MemoryDevice
Source§fn size_bytes(&self) -> Result<u64>
fn size_bytes(&self) -> Result<u64>
Total addressable bytes of the underlying device.
Source§fn read_at(&mut self, offset: u64, buf: &mut [u8]) -> Result<()>
fn read_at(&mut self, offset: u64, buf: &mut [u8]) -> Result<()>
Read exactly
buf.len() bytes at offset. Errors if read short.Auto Trait Implementations§
impl Freeze for MemoryDevice
impl RefUnwindSafe for MemoryDevice
impl Send for MemoryDevice
impl Sync for MemoryDevice
impl Unpin for MemoryDevice
impl UnsafeUnpin for MemoryDevice
impl UnwindSafe for MemoryDevice
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