[−][src]Struct unsafe_io::RawHandleOrSocket
A Windows analog for the Posix-ish AsRawFd
type. Unlike Posix-ish
platforms which have a single type for files and sockets, Windows has
distinct types, RawHandle
and RawSocket
; this type behaves like an
enum which can hold either.
It's reasonable to worry that this might be trying too hard to make Windows
work like Unix, however in this case, the number of types is small, so the
enum is simple and the overhead is relatively low, and the benefit is that
we can abstract over major Read
and Write
resources.
Implementations
impl RawHandleOrSocket
[src]
pub fn from_raw_handle(raw_handle: RawHandle) -> Self
[src]
Like FromRawHandle::from_raw_handle
, but isn't unsafe because it
doesn't imply a dereference.
pub fn from_raw_socket(raw_socket: RawSocket) -> Self
[src]
Like FromRawSocket::from_raw_socket
, but isn't unsafe because it
doesn't imply a dereference.
pub fn as_raw_handle(&self) -> Option<RawHandle>
[src]
Like AsRawHandle::as_raw_handle
, but returns an Option
so that
it can return None
if self
doesn't contain a RawHandle
.
pub fn as_raw_socket(&self) -> Option<RawSocket>
[src]
Like AsRawSocket::as_raw_socket
, but returns an Option
so that
it can return None
if self
doesn't contain a RawSocket
.
Trait Implementations
impl AsRawHandleOrSocket for RawHandleOrSocket
[src]
pub fn as_raw_handle_or_socket(&self) -> Self
[src]
impl Clone for RawHandleOrSocket
[src]
pub fn clone(&self) -> RawHandleOrSocket
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for RawHandleOrSocket
[src]
impl Debug for RawHandleOrSocket
[src]
impl Eq for RawHandleOrSocket
[src]
impl Hash for RawHandleOrSocket
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for RawHandleOrSocket
[src]
pub fn cmp(&self, other: &RawHandleOrSocket) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<RawHandleOrSocket> for RawHandleOrSocket
[src]
pub fn eq(&self, other: &RawHandleOrSocket) -> bool
[src]
pub fn ne(&self, other: &RawHandleOrSocket) -> bool
[src]
impl PartialOrd<RawHandleOrSocket> for RawHandleOrSocket
[src]
pub fn partial_cmp(&self, other: &RawHandleOrSocket) -> Option<Ordering>
[src]
pub fn lt(&self, other: &RawHandleOrSocket) -> bool
[src]
pub fn le(&self, other: &RawHandleOrSocket) -> bool
[src]
pub fn gt(&self, other: &RawHandleOrSocket) -> bool
[src]
pub fn ge(&self, other: &RawHandleOrSocket) -> bool
[src]
impl Send for RawHandleOrSocket
[src]
impl StructuralEq for RawHandleOrSocket
[src]
impl StructuralPartialEq for RawHandleOrSocket
[src]
impl Sync for RawHandleOrSocket
[src]
The Windows HANDLE
and SOCKET
types may be shared between threads.
Auto Trait Implementations
impl RefUnwindSafe for RawHandleOrSocket
[src]
impl Unpin for RawHandleOrSocket
[src]
impl UnwindSafe for RawHandleOrSocket
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,