Struct x11rb_async::utils::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: 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<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§
§impl<T> AsRawFilelike for Twhere
T: AsRawFd,
impl<T> AsRawFilelike for Twhere T: AsRawFd,
§fn as_raw_filelike(&self) -> i32
fn as_raw_filelike(&self) -> i32
Returns the raw value.
§impl<T> AsRawSocketlike for Twhere
T: AsRawFd,
impl<T> AsRawSocketlike for Twhere T: AsRawFd,
§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
§impl<T> FromFd for Twhere
T: From<OwnedFd>,
impl<T> FromFd for Twhere T: From<OwnedFd>,
§impl<T> FromFilelike for Twhere
T: From<OwnedFd>,
impl<T> FromFilelike for Twhere T: From<OwnedFd>,
§fn from_filelike(owned: OwnedFd) -> T
fn from_filelike(owned: OwnedFd) -> T
Constructs a new instance of
Self from the given filelike object. Read more§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 more§impl<T> FromSocketlike for Twhere
T: From<OwnedFd>,
impl<T> FromSocketlike for Twhere T: From<OwnedFd>,
§fn from_socketlike(owned: OwnedFd) -> T
fn from_socketlike(owned: OwnedFd) -> T
Constructs a new instance of
Self from the given socketlike object.§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.