Struct SharedFd
pub struct SharedFd<T>(/* private fields */);Expand description
A shared fd. It is passed to the operations to make sure the fd won’t be closed before the operations complete.
Implementations§
pub unsafe fn new_unchecked(fd: T) -> SharedFd<T>
pub unsafe fn new_unchecked(fd: T) -> SharedFd<T>
pub fn try_unwrap(self) -> Result<T, SharedFd<T>>
pub fn try_unwrap(self) -> Result<T, SharedFd<T>>
Try to take the inner owned fd.
Trait Implementations§
§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Extracts the borrowed fd.
§unsafe fn wsa_accept_ex(
&self,
accept_socket: usize,
output_buffer: *mut c_void,
receive_data_length: u32,
local_address_length: u32,
remote_address_length: u32,
bytes_received: *mut u32,
overlapped: *mut OVERLAPPED,
) -> Poll<Result<usize, Error>>
unsafe fn wsa_accept_ex( &self, accept_socket: usize, output_buffer: *mut c_void, receive_data_length: u32, local_address_length: u32, remote_address_length: u32, bytes_received: *mut u32, overlapped: *mut OVERLAPPED, ) -> Poll<Result<usize, Error>>
AcceptEx. Read more§unsafe fn wsa_get_accept_ex_sockaddrs(
&self,
output_buffer: *const c_void,
receive_data_length: u32,
local_address_length: u32,
remote_address_length: u32,
local_sockaddr: *mut *mut SOCKADDR,
local_sockaddr_length: *mut i32,
remote_sockaddr: *mut *mut SOCKADDR,
remote_sockaddr_length: *mut i32,
) -> Result<(), Error>
unsafe fn wsa_get_accept_ex_sockaddrs( &self, output_buffer: *const c_void, receive_data_length: u32, local_address_length: u32, remote_address_length: u32, local_sockaddr: *mut *mut SOCKADDR, local_sockaddr_length: *mut i32, remote_sockaddr: *mut *mut SOCKADDR, remote_sockaddr_length: *mut i32, ) -> Result<(), Error>
GetAcceptExSockaddrs. Read more§unsafe fn wsa_connect_ex(
&self,
name: *const SOCKADDR,
name_length: i32,
send_buffer: *const c_void,
send_data_length: u32,
bytes_sent: *mut u32,
overlapped: *mut OVERLAPPED,
) -> Poll<Result<usize, Error>>
unsafe fn wsa_connect_ex( &self, name: *const SOCKADDR, name_length: i32, send_buffer: *const c_void, send_data_length: u32, bytes_sent: *mut u32, overlapped: *mut OVERLAPPED, ) -> Poll<Result<usize, Error>>
ConnectEx. Read more§unsafe fn from_raw_socket(sock: u64) -> SharedFd<T>
unsafe fn from_raw_socket(sock: u64) -> SharedFd<T>
Constructs a new I/O object from the specified raw socket. Read more
Return a cloned
SharedFd.Auto Trait Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromRawFd for Twhere
T: FromRawSocket,
impl<T> FromRawFd for Twhere
T: FromRawSocket,
§unsafe fn from_raw_fd(raw_fd: u64) -> T
unsafe fn from_raw_fd(raw_fd: u64) -> T
A version of
from_raw_fd for use with Winsock API. Read more§impl<T> FromRawFilelike for Twhere
T: FromRawHandle,
impl<T> FromRawFilelike for Twhere
T: FromRawHandle,
§unsafe fn from_raw_filelike(raw: *mut c_void) -> T
unsafe fn from_raw_filelike(raw: *mut c_void) -> T
Constructs
Self from the raw value.§impl<T> FromRawFilelike for Twhere
T: FromRawHandle,
impl<T> FromRawFilelike for Twhere
T: FromRawHandle,
§unsafe fn from_raw_filelike(raw: *mut c_void) -> T
unsafe fn from_raw_filelike(raw: *mut c_void) -> T
Constructs
Self from the raw value.§impl<T> FromRawSocketlike for Twhere
T: FromRawSocket,
impl<T> FromRawSocketlike for Twhere
T: FromRawSocket,
§unsafe fn from_raw_socketlike(raw: u64) -> T
unsafe fn from_raw_socketlike(raw: u64) -> T
Constructs
Self from the raw value.§impl<T> FromRawSocketlike for Twhere
T: FromRawSocket,
impl<T> FromRawSocketlike for Twhere
T: FromRawSocket,
§unsafe fn from_raw_socketlike(raw: u64) -> T
unsafe fn from_raw_socketlike(raw: u64) -> T
Constructs
Self from the raw value.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more