pub struct Handle(OwnedHandle);
🔬This is a nightly-only experimental API. (
windows_handle
)Expand description
An owned container for HANDLE
object, closing them on Drop.
All methods are inherited through a Deref
impl to RawHandle
Tuple Fields§
§0: OwnedHandle
🔬This is a nightly-only experimental API. (
windows_handle
)Implementations§
source§impl Handle
impl Handle
pub fn read(&self, buf: &mut [u8]) -> Result<usize>
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn is_read_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn read_buf(&self, cursor: BorrowedCursor<'_>) -> Result<()>
🔬This is a nightly-only experimental API. (
windows_handle
)pub unsafe fn read_overlapped( &self, buf: &mut [u8], overlapped: *mut OVERLAPPED ) -> Result<Option<usize>>
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn overlapped_result( &self, overlapped: *mut OVERLAPPED, wait: bool ) -> Result<usize>
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn cancel_io(&self) -> Result<()>
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn write(&self, buf: &[u8]) -> Result<usize>
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> Result<usize>
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn write_at(&self, buf: &[u8], offset: u64) -> Result<usize>
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn try_clone(&self) -> Result<Self>
🔬This is a nightly-only experimental API. (
windows_handle
)pub fn duplicate( &self, access: c_ulong, inherit: bool, options: c_ulong ) -> Result<Self>
🔬This is a nightly-only experimental API. (
windows_handle
)sourceunsafe fn synchronous_read(
&self,
buf: *mut MaybeUninit<u8>,
len: usize,
offset: Option<u64>
) -> Result<usize>
🔬This is a nightly-only experimental API. (windows_handle
)
unsafe fn synchronous_read( &self, buf: *mut MaybeUninit<u8>, len: usize, offset: Option<u64> ) -> Result<usize>
windows_handle
)Performs a synchronous read.
If the handle is opened for asynchronous I/O then this abort the process. See #81357.
If offset
is None
then the current file position is used.
sourcefn synchronous_write(&self, buf: &[u8], offset: Option<u64>) -> Result<usize>
🔬This is a nightly-only experimental API. (windows_handle
)
fn synchronous_write(&self, buf: &[u8], offset: Option<u64>) -> Result<usize>
windows_handle
)Performs a synchronous write.
If the handle is opened for asynchronous I/O then this abort the process. See #81357.
If offset
is None
then the current file position is used.
Trait Implementations§
source§impl AsHandle for Handle
impl AsHandle for Handle
source§fn as_handle(&self) -> BorrowedHandle<'_>
fn as_handle(&self) -> BorrowedHandle<'_>
Available on Windows only.
Borrows the handle. Read more
source§impl AsRawHandle for Handle
impl AsRawHandle for Handle
source§fn as_raw_handle(&self) -> RawHandle
fn as_raw_handle(&self) -> RawHandle
Available on Windows only.
Extracts the raw handle. Read more
source§impl FromRawHandle for Handle
impl FromRawHandle for Handle
source§unsafe fn from_raw_handle(raw_handle: RawHandle) -> Self
unsafe fn from_raw_handle(raw_handle: RawHandle) -> Self
Available on Windows only.
Constructs a new I/O object from the specified raw handle. Read more
source§impl IntoRawHandle for Handle
impl IntoRawHandle for Handle
source§fn into_raw_handle(self) -> RawHandle
fn into_raw_handle(self) -> RawHandle
Available on Windows only.
Consumes this object, returning the raw underlying handle. Read more
source§impl<'a> Read for &'a Handle
impl<'a> Read for &'a Handle
source§fn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
Pull some bytes from this source into the specified buffer, returning
how many bytes were read. Read more
source§fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<()>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<()>
🔬This is a nightly-only experimental API. (
read_buf
#78485)Pull some bytes from this source into the specified buffer. Read more
source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
Like
read
, except that it reads into a slice of buffers. Read moresource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
#69941)1.0.0 · source§fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
Read all bytes until EOF in this source, placing them into
buf
. Read more1.0.0 · source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
Read all bytes until EOF in this source, appending them to
buf
. Read more1.6.0 · source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
Read the exact number of bytes required to fill
buf
. Read moresource§fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<()>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<()>
🔬This is a nightly-only experimental API. (
read_buf
#78485)Read the exact number of bytes required to fill
cursor
. Read more1.0.0 · source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere Self: Sized,
Creates a “by reference” adaptor for this instance of
Read
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
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