pub enum Fd {
None(&'static Location<'static>),
Owned(OwnedFd),
Borrowed(RawFd),
}Variants§
Implementations§
Source§impl Fd
impl Fd
Sourcepub unsafe fn from_raw_fd(fd: RawFd) -> Self
pub unsafe fn from_raw_fd(fd: RawFd) -> Self
§Safety
The resource pointed to by fd must be open and suitable for assuming
ownership. The resource must not require any cleanup other than close.
§Safety
Given fd must not be closed as long as the created Fd is alive.
pub fn close(&mut self)
pub fn try_as_raw_fd(&self) -> Result<RawFd>
pub fn is_readable(&self) -> Result<bool>
pub fn is_writeable(&self) -> Result<bool>
Sourcepub unsafe fn ioctl_ptr<T>(&self, request: c_ulong, p: *mut T) -> Result<i32>
pub unsafe fn ioctl_ptr<T>(&self, request: c_ulong, p: *mut T) -> Result<i32>
§Safety
require p to match the request
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fd
impl RefUnwindSafe for Fd
impl Send for Fd
impl Sync for Fd
impl Unpin for Fd
impl UnwindSafe for Fd
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