Struct io_extras::raw::RawReadable
source · [−]#[repr(transparent)]pub struct RawReadable(_);
Expand description
A non-owning unsafe I/O handle that implements Read
. Read
functions
are considered safe, so this type requires unsafe
to construct.
This doesn’t implement Into*
or From*
traits.
Platform-specific behavior
On Posix-ish platforms, this reads from the handle as if it were a
File
. On Windows, this reads from a file-like handle as if it were a
File
, and from a socket-like handle as if it were a TcpStream
.
Trait Implementations
sourceimpl AsRawFd for RawReadable
impl AsRawFd for RawReadable
RawReadable
doesn’t own its handle.
sourceimpl Clone for RawReadable
impl Clone for RawReadable
sourcefn clone(&self) -> RawReadableⓘNotable traits for RawReadableimpl Read for RawReadable
fn clone(&self) -> RawReadableⓘNotable traits for RawReadableimpl Read for RawReadable
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RawReadable
impl Debug for RawReadable
sourceimpl FromRawFd for RawReadable
impl FromRawFd for RawReadable
RawReadable
doesn’t own its handle.
sourceunsafe fn from_raw_fd(raw_fd: RawFd) -> Self
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self
Constructs a new instance of Self
from the given raw file
descriptor. Read more
sourceimpl IntoRawFd for RawReadable
impl IntoRawFd for RawReadable
RawReadable
doesn’t own its handle.
sourcefn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
sourceimpl Read for RawReadable
impl Read for RawReadable
sourcefn 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
sourcefn 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 more
sourcefn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
sourcefn 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 more
sourcefn 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 more
sourcefn 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 more
sourcefn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
read_buf
)Pull some bytes from this source into the specified buffer. Read more
sourcefn read_buf_exact(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
read_buf
)Read the exact number of bytes required to fill buf
. Read more
1.0.0 · sourcefn by_ref(&mut self) -> &mut Self
fn by_ref(&mut self) -> &mut Self
Creates a “by reference” adaptor for this instance of Read
. Read more
impl Copy for RawReadable
Auto Trait Implementations
impl RefUnwindSafe for RawReadable
impl Send for RawReadable
impl Sync for RawReadable
impl Unpin for RawReadable
impl UnwindSafe for RawReadable
Blanket Implementations
sourceimpl<T> AsRawFilelike for T where
T: AsRawFd,
impl<T> AsRawFilelike for T where
T: AsRawFd,
sourcefn as_raw_filelike(&self) -> i32
fn as_raw_filelike(&self) -> i32
Returns the raw value.
sourceimpl<T> AsRawGrip for T where
T: AsRawFd,
impl<T> AsRawGrip for T where
T: AsRawFd,
sourcefn as_raw_grip(&self) -> i32
fn as_raw_grip(&self) -> i32
Extracts the raw grip.
sourceimpl<T> AsRawSocketlike for T where
T: AsRawFd,
impl<T> AsRawSocketlike for T where
T: AsRawFd,
sourcefn as_raw_socketlike(&self) -> i32
fn as_raw_socketlike(&self) -> i32
Returns the raw value.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FromRawFilelike for T where
T: FromRawFd,
impl<T> FromRawFilelike for T where
T: FromRawFd,
sourceunsafe fn from_raw_filelike(raw: i32) -> T
unsafe fn from_raw_filelike(raw: i32) -> T
Constructs Self
from the raw value. Read more
sourceimpl<T> FromRawGrip for T where
T: FromRawFd,
impl<T> FromRawGrip for T where
T: FromRawFd,
sourceunsafe fn from_raw_grip(raw_grip: i32) -> T
unsafe fn from_raw_grip(raw_grip: i32) -> T
Consume an RawGrip
and convert into a Self
. Read more
sourceimpl<T> FromRawSocketlike for T where
T: FromRawFd,
impl<T> FromRawSocketlike for T where
T: FromRawFd,
sourceunsafe fn from_raw_socketlike(raw: i32) -> T
unsafe fn from_raw_socketlike(raw: i32) -> T
Constructs Self
from the raw value. Read more
sourceimpl<T> IntoRawFilelike for T where
T: IntoRawFd,
impl<T> IntoRawFilelike for T where
T: IntoRawFd,
sourcefn into_raw_filelike(self) -> i32
fn into_raw_filelike(self) -> i32
Returns the raw value.
sourceimpl<T> IntoRawGrip for T where
T: IntoRawFd,
impl<T> IntoRawGrip for T where
T: IntoRawFd,
sourcefn into_raw_grip(self) -> i32
fn into_raw_grip(self) -> i32
Consume self
and convert into an RawGrip
.
sourceimpl<T> IntoRawSocketlike for T where
T: IntoRawFd,
impl<T> IntoRawSocketlike for T where
T: IntoRawFd,
sourcefn into_raw_socketlike(self) -> i32
fn into_raw_socketlike(self) -> i32
Returns the raw value.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more