Struct x11rb_protocol::RawFdContainer
source · [−]pub struct RawFdContainer(_);
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: RawFd) -> Self
pub fn new(fd: RawFd) -> Self
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<Self, Error>
pub fn try_clone(&self) -> Result<Self, 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) -> RawFd
pub fn into_raw_fd(self) -> RawFd
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: IntoRawFd> From<T> for RawFdContainer
impl<T: IntoRawFd> From<T> for RawFdContainer
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