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 moreSource§impl IntoRawFd for Fd
impl IntoRawFd for Fd
Source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
Auto Trait Implementations§
impl Freeze for Fd
impl RefUnwindSafe for Fd
impl Send for Fd
impl Sync for Fd
impl Unpin for Fd
impl UnsafeUnpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more