pub struct Fd(/* private fields */);Expand description
Generic file descriptor wrapper with file type information.
Implementations§
Source§impl Fd
impl Fd
Sourcepub fn socket_domain(&self) -> Result<AddressFamily, Error>
pub fn socket_domain(&self) -> Result<AddressFamily, Error>
Determine socket communication domain.
Sourcepub fn socket_type(&self) -> Result<SockType, Error>
pub fn socket_type(&self) -> Result<SockType, Error>
Determine socket type.
Sourcepub fn socket_protocol(&self) -> Result<Option<SockProtocol>, Error>
pub fn socket_protocol(&self) -> Result<Option<SockProtocol>, Error>
Determine socket protocol.
Sourcepub fn is_listening(&self) -> Result<bool, Error>
pub fn is_listening(&self) -> Result<bool, Error>
Returns true if the socket is accepting connections.
Sourcepub fn is_writeable(&self) -> Result<bool, Error>
pub fn is_writeable(&self) -> Result<bool, Error>
Returns true if the file is writeable.
Trait Implementations§
Source§impl AsFd for Fd
impl AsFd for Fd
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Source§impl FileTypeExt for Fd
impl FileTypeExt for Fd
Source§fn is_block_device(&self) -> bool
fn is_block_device(&self) -> bool
Returns
true if this file type is a block device. Read moreSource§fn is_char_device(&self) -> bool
fn is_char_device(&self) -> bool
Returns
true if this file type is a char device. Read moreAuto 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