pub struct MapIfSafeError {
pub(crate) inner: MapIfSafeErrorInner,
}Expand description
Error returned by MmapOptions::map_if_safe().
Allows you to distinguish between three failure modes:
- Safe mapping is not supported on this platform.
- Trying to map an unsafe file descriptor.
- The map attempt itself failed.
The error is convertible to std::io::Error.
Fields§
§inner: MapIfSafeErrorInnerImplementations§
Source§impl MapIfSafeError
impl MapIfSafeError
pub(crate) fn new_not_supported() -> Self
pub(crate) fn new_not_safe(reason: Error) -> Self
pub(crate) fn new_map_failed(reason: Error) -> Self
Sourcepub fn not_supported(&self) -> bool
pub fn not_supported(&self) -> bool
Indicates that safe mapping is not supported at all on this platform.
Sourcepub fn not_safe(&self) -> bool
pub fn not_safe(&self) -> bool
Indicates if the map was refused because mapping the file descriptor is not safe.
Sourcepub fn map_failed(&self) -> bool
pub fn map_failed(&self) -> bool
Indicates if the file descriptor to be mapped was considered safe, but the mapping itself failed.
Trait Implementations§
Source§impl Debug for MapIfSafeError
impl Debug for MapIfSafeError
Source§impl Display for MapIfSafeError
impl Display for MapIfSafeError
Source§impl Error for MapIfSafeError
impl Error for MapIfSafeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<MapIfSafeError> for Error
impl From<MapIfSafeError> for Error
Source§fn from(value: MapIfSafeError) -> Self
fn from(value: MapIfSafeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for MapIfSafeError
impl !UnwindSafe for MapIfSafeError
impl Freeze for MapIfSafeError
impl Send for MapIfSafeError
impl Sync for MapIfSafeError
impl Unpin for MapIfSafeError
impl UnsafeUnpin for MapIfSafeError
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