pub struct Fd(_);
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
sourceimpl 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 dup
ed 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
sourceimpl AsRawFd for RawFdContainer
impl AsRawFd for RawFdContainer
sourceimpl Debug for RawFdContainer
impl Debug for RawFdContainer
sourceimpl Drop for RawFdContainer
impl Drop for RawFdContainer
sourceimpl<T> From<T> for RawFdContainer where
T: IntoRawFd,
impl<T> From<T> for RawFdContainer where
T: IntoRawFd,
sourcefn from(fd: T) -> RawFdContainer
fn from(fd: T) -> RawFdContainer
Converts to this type from the input type.
sourceimpl Hash for RawFdContainer
impl Hash for RawFdContainer
sourceimpl PartialEq<RawFdContainer> for RawFdContainer
impl PartialEq<RawFdContainer> for RawFdContainer
sourcefn eq(&self, other: &RawFdContainer) -> bool
fn eq(&self, other: &RawFdContainer) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RawFdContainer) -> bool
fn ne(&self, other: &RawFdContainer) -> bool
This method tests for !=
.
impl Eq for RawFdContainer
impl StructuralEq for RawFdContainer
impl StructuralPartialEq for RawFdContainer
Auto Trait Implementations
impl RefUnwindSafe for RawFdContainer
impl Send for RawFdContainer
impl Sync for RawFdContainer
impl Unpin for RawFdContainer
impl UnwindSafe for RawFdContainer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more