pub enum MemoryMap {
Readable(ReadableMemoryMap),
Writable(WritableMemoryMap),
}
Variants§
Readable(ReadableMemoryMap)
Writable(WritableMemoryMap)
Implementations§
Source§impl MemoryMap
impl MemoryMap
pub fn read(&self) -> ReadGuard
pub fn into_read(self) -> ReadGuard
Sourcepub fn try_write(&self) -> Result<WriteGuard, DerefError>
pub fn try_write(&self) -> Result<WriteGuard, DerefError>
§Errors
- Returns
ReadOnly
if memory map is read-only.
Sourcepub fn try_into_write(self) -> Result<WriteGuard, DerefError>
pub fn try_into_write(self) -> Result<WriteGuard, DerefError>
§Errors
- Returns
ReadOnly
if memory map is read-only.
pub fn read_with<F, R>(&self, closure: F) -> R
Sourcepub fn try_write_with<F, R>(&self, closure: F) -> Result<R, DerefError>
pub fn try_write_with<F, R>(&self, closure: F) -> Result<R, DerefError>
§Errors
- Returns
ReadOnly
if memory map is read-only.
pub fn as_ptr(&self) -> *const u8
Sourcepub fn try_as_mut_ptr(&self) -> Result<*mut u8, DerefError>
pub fn try_as_mut_ptr(&self) -> Result<*mut u8, DerefError>
§Errors
- Returns
ReadOnly
if memory map is read-only.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl From<&WriteGuard> for MemoryMap
impl From<&WriteGuard> for MemoryMap
Source§fn from(value: &WriteGuard) -> Self
fn from(value: &WriteGuard) -> Self
Converts to this type from the input type.
Source§impl From<WriteGuard> for MemoryMap
impl From<WriteGuard> for MemoryMap
Source§fn from(value: WriteGuard) -> Self
fn from(value: WriteGuard) -> Self
Converts to this type from the input type.
Source§impl TryFrom<&MemoryMap> for WriteGuard
impl TryFrom<&MemoryMap> for WriteGuard
Auto Trait Implementations§
impl Freeze for MemoryMap
impl !RefUnwindSafe for MemoryMap
impl Send for MemoryMap
impl Sync for MemoryMap
impl Unpin for MemoryMap
impl !UnwindSafe for MemoryMap
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