pub struct FDInfo {
pub fd: i32,
pub mode: u16,
pub target: FDTarget,
}
Expand description
See the Process::fd() method
Fields§
§fd: i32
The file descriptor
mode: u16
The permission bits for this FD
Note: this field is only the owner read/write/execute bits. All the other bits
(include filetype bits) are masked out. See also the mode()
method.
target: FDTarget
Implementations§
source§impl FDInfo
impl FDInfo
sourcepub fn from_raw_fd(pid: i32, raw_fd: i32) -> ProcResult<Self>
pub fn from_raw_fd(pid: i32, raw_fd: i32) -> ProcResult<Self>
Gets a file descriptor from a raw fd
sourcepub fn from_raw_fd_with_root(
root: impl AsRef<Path>,
pid: i32,
raw_fd: i32
) -> ProcResult<Self>
pub fn from_raw_fd_with_root( root: impl AsRef<Path>, pid: i32, raw_fd: i32 ) -> ProcResult<Self>
Gets a file descriptor from a raw fd based on a specified /proc
path
sourcepub fn mode(&self) -> FDPermissions
pub fn mode(&self) -> FDPermissions
Gets the read/write mode of this file descriptor as a bitfield
Trait Implementations§
source§impl<'de> Deserialize<'de> for FDInfo
impl<'de> Deserialize<'de> for FDInfo
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for FDInfo
impl Send for FDInfo
impl Sync for FDInfo
impl Unpin for FDInfo
impl UnwindSafe for FDInfo
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