pub struct Fd(/* private fields */);Expand description
A simple wrapper around RawFd that closes the fd on drop.
On non-unix systems, this type is empty and does not provide any method.
Implementations§
Source§impl RawFdContainer
impl RawFdContainer
Sourcepub fn new(fd: i32) -> RawFdContainer
pub fn new(fd: i32) -> RawFdContainer
Create a new RawFdContainer for the given RawFd.
The RawFdContainer takes ownership of the RawFd and closes it on drop.
Sourcepub fn try_clone(&self) -> Result<RawFdContainer, Error>
pub fn try_clone(&self) -> Result<RawFdContainer, Error>
Tries to clone the RawFdContainer creating a new FD
with dup. The new RawFdContainer will take ownership
of the duped version, whereas the original RawFdContainer
will keep the ownership of its FD.
Sourcepub fn into_raw_fd(self) -> i32
pub fn into_raw_fd(self) -> i32
Get the RawFd out of this RawFdContainer.
This function would be an implementation of IntoRawFd if that were possible. However, it
causes a conflict with an impl from libcore…
Trait Implementations§
Source§impl AsRawFd for RawFdContainer
impl AsRawFd for RawFdContainer
Source§impl Debug for RawFdContainer
impl Debug for RawFdContainer
Source§impl Drop for RawFdContainer
impl Drop for RawFdContainer
Source§impl<T> From<T> for RawFdContainerwhere
T: IntoRawFd,
impl<T> From<T> for RawFdContainerwhere
T: IntoRawFd,
Source§fn from(fd: T) -> RawFdContainer
fn from(fd: T) -> RawFdContainer
Converts to this type from the input type.
Source§impl Hash for RawFdContainer
impl Hash for RawFdContainer
Source§impl PartialEq for RawFdContainer
impl PartialEq for RawFdContainer
impl Eq for RawFdContainer
impl StructuralPartialEq for RawFdContainer
Auto Trait Implementations§
impl Freeze for RawFdContainer
impl RefUnwindSafe for RawFdContainer
impl Send for RawFdContainer
impl Sync for RawFdContainer
impl Unpin for RawFdContainer
impl UnwindSafe for RawFdContainer
Blanket Implementations§
Source§impl<T> AsRawFilelike for Twhere
T: AsRawFd,
impl<T> AsRawFilelike for Twhere
T: AsRawFd,
Source§fn as_raw_filelike(&self) -> i32
fn as_raw_filelike(&self) -> i32
Returns the raw value.
Source§impl<T> AsRawSocketlike for Twhere
T: AsRawFd,
impl<T> AsRawSocketlike for Twhere
T: AsRawFd,
Source§fn as_raw_socketlike(&self) -> i32
fn as_raw_socketlike(&self) -> i32
Returns the raw value.
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> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> FromFd for T
impl<T> FromFd for T
Source§impl<T> FromFilelike for T
impl<T> FromFilelike for T
Source§fn from_filelike(owned: OwnedFd) -> T
fn from_filelike(owned: OwnedFd) -> T
Constructs a new instance of
Self from the given filelike object. Read moreSource§fn from_into_filelike<Owned>(owned: Owned) -> Twhere
Owned: IntoFilelike,
fn from_into_filelike<Owned>(owned: Owned) -> Twhere
Owned: IntoFilelike,
Constructs a new instance of
Self from the given filelike object
converted from into_owned. Read moreSource§impl<T> FromSocketlike for T
impl<T> FromSocketlike for T
Source§fn from_socketlike(owned: OwnedFd) -> T
fn from_socketlike(owned: OwnedFd) -> T
Constructs a new instance of
Self from the given socketlike object.Source§fn from_into_socketlike<Owned>(owned: Owned) -> Twhere
Owned: IntoSocketlike,
fn from_into_socketlike<Owned>(owned: Owned) -> Twhere
Owned: IntoSocketlike,
Constructs a new instance of
Self from the given socketlike object
converted from into_owned.