pub struct BorrowedHandleOrSocket<'a> { /* private fields */ }
Expand description
HandleOrSocket
variant of io-lifetimes’
BorrowedHandle
/BorrowedSocket
.
Implementations§
Source§impl<'a> BorrowedHandleOrSocket<'a>
impl<'a> BorrowedHandleOrSocket<'a>
Sourcepub unsafe fn borrow_raw(raw: RawHandleOrSocket) -> Self
pub unsafe fn borrow_raw(raw: RawHandleOrSocket) -> Self
Return a BorrowedHandleOrSocket
holding the given raw handle or
socket.
§Safety
The resource pointed to by raw
must remain open for the duration of
the returned BorrowedHandleOrSocket
, and it must not be a null handle
or an invalid socket.
Sourcepub fn from_handle(handle: BorrowedHandle<'a>) -> Self
pub fn from_handle(handle: BorrowedHandle<'a>) -> Self
Construct a BorrowedHandleOrSocket
from a BorrowedHandle
.
Sourcepub fn from_socket(socket: BorrowedSocket<'a>) -> Self
pub fn from_socket(socket: BorrowedSocket<'a>) -> Self
Construct a BorrowedHandleOrSocket
from a BorrowedSocket
.
Sourcepub fn as_handle(&self) -> Option<BorrowedHandle<'a>>
pub fn as_handle(&self) -> Option<BorrowedHandle<'a>>
Like AsHandle::as_handle
, but returns an Option
so that
it can return None
if self
doesn’t contain a BorrowedHandle
.
Sourcepub fn as_socket(&self) -> Option<BorrowedSocket<'a>>
pub fn as_socket(&self) -> Option<BorrowedSocket<'a>>
Like AsSocket::as_socket
, but returns an Option
so that
it can return None
if self
doesn’t contain a BorrowedSocket
.
Trait Implementations§
Source§impl AsHandleOrSocket for BorrowedHandleOrSocket<'_>
impl AsHandleOrSocket for BorrowedHandleOrSocket<'_>
Source§fn as_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>
fn as_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>
Like
AsHandle::as_handle
and AsSocket::as_socket
but can return either type.Source§impl AsRawHandleOrSocket for BorrowedHandleOrSocket<'_>
impl AsRawHandleOrSocket for BorrowedHandleOrSocket<'_>
Source§fn as_raw_handle_or_socket(&self) -> RawHandleOrSocket
fn as_raw_handle_or_socket(&self) -> RawHandleOrSocket
Like
AsRawHandle::as_raw_handle
and AsRawSocket::as_raw_socket
but can return either type.Source§impl<'a> Clone for BorrowedHandleOrSocket<'a>
impl<'a> Clone for BorrowedHandleOrSocket<'a>
Source§fn clone(&self) -> BorrowedHandleOrSocket<'a>
fn clone(&self) -> BorrowedHandleOrSocket<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BorrowedHandleOrSocket<'_>
impl Debug for BorrowedHandleOrSocket<'_>
impl<'a> Copy for BorrowedHandleOrSocket<'a>
Auto Trait Implementations§
impl<'a> Freeze for BorrowedHandleOrSocket<'a>
impl<'a> RefUnwindSafe for BorrowedHandleOrSocket<'a>
impl<'a> Send for BorrowedHandleOrSocket<'a>
impl<'a> Sync for BorrowedHandleOrSocket<'a>
impl<'a> Unpin for BorrowedHandleOrSocket<'a>
impl<'a> UnwindSafe for BorrowedHandleOrSocket<'a>
Blanket Implementations§
Source§impl<T> AsGrip for Twhere
T: AsHandleOrSocket,
impl<T> AsGrip for Twhere
T: AsHandleOrSocket,
Source§fn as_grip(&self) -> BorrowedHandleOrSocket<'_>
fn as_grip(&self) -> BorrowedHandleOrSocket<'_>
Extracts the grip.
Source§impl<T> AsRawGrip for Twhere
T: AsRawHandleOrSocket,
impl<T> AsRawGrip for Twhere
T: AsRawHandleOrSocket,
Source§fn as_raw_grip(&self) -> RawHandleOrSocket
fn as_raw_grip(&self) -> RawHandleOrSocket
Extracts the raw grip.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)