Struct memfile::FromFdError
source · pub struct FromFdError { /* private fields */ }
Expand description
Error returned when the file passed to MemFile::from_fd
is not created by memfd_create
.
This struct contains the std::io::Error
that occurred and the original OwnedFd
.
It is also directly convertible to std::io::Error
, so you can pass it up using the ?
operator
from a function that returns an std::io::Result
.
Implementations§
source§impl FromFdError
impl FromFdError
sourcepub fn fd(&self) -> BorrowedFd<'_>
pub fn fd(&self) -> BorrowedFd<'_>
Get a the original file descriptor as BorrowedFd
.
sourcepub fn into_parts(self) -> (Error, OwnedFd)
pub fn into_parts(self) -> (Error, OwnedFd)
Consume the struct and return the I/O error and the original file object as tuple.
sourcepub fn into_error(self) -> Error
pub fn into_error(self) -> Error
Consume the struct and return the I/O error.
Trait Implementations§
source§impl From<FromFdError> for Error
impl From<FromFdError> for Error
source§fn from(other: FromFdError) -> Self
fn from(other: FromFdError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for FromFdError
impl Send for FromFdError
impl Sync for FromFdError
impl Unpin for FromFdError
impl !UnwindSafe for FromFdError
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