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§
source§impl 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§
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: IntoRawFd> From<T> for RawFdContainer
impl<T: IntoRawFd> From<T> for RawFdContainer
source§impl Hash for RawFdContainer
impl Hash for RawFdContainer
source§impl PartialEq<RawFdContainer> for RawFdContainer
impl PartialEq<RawFdContainer> for RawFdContainer
source§fn 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 ==
.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§
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