Struct genio::util::Restarting
[−]
[src]
pub struct Restarting<T>(_);
Restarts all interrupted operations.
All Read and Write operations that might fail with error indicating interruption (like EINTR) will be restarted when wrapped in this type.
The error types indicate that interrupted error case has been handled.
Methods
impl<T> Restarting<T>
[src]
fn new(io: T) -> Self
Creates restarting IO.
fn into_inner(self) -> T
Converts to lower-level reader.
Trait Implementations
impl<R> Read for Restarting<R> where
R: Read,
R::ReadError: IntoIntrError,
[src]
R: Read,
R::ReadError: IntoIntrError,
type ReadError = <<R as Read>::ReadError as IntoIntrError>::NonIntr
Value of this type is returned when read()
fails. Read more
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::ReadError>
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
fn read_exact(
&mut self,
buf: &mut [u8]
) -> Result<(), ReadExactError<Self::ReadError>>
&mut self,
buf: &mut [u8]
) -> Result<(), ReadExactError<Self::ReadError>>
Read the exact number of bytes required to fill buf
. Read more
fn available_bytes(&self, _at_least: usize) -> bool
Hints whether there are at least at_least
bytes available. Read more
fn chain<R: Read>(self, other: R) -> Chain<Self, R> where
Self: Sized,
Self: Sized,
Chains another reader after self
. When self ends (returns Ok(0)), the other reader will provide bytes to read. Read more
fn read_to_end<T: ExtendFromReader>(
&mut self,
container: &mut T
) -> Result<usize, ExtendError<Self::ReadError, T::ExtendError>> where
Self: ReadOverwrite,
&mut self,
container: &mut T
) -> Result<usize, ExtendError<Self::ReadError, T::ExtendError>> where
Self: ReadOverwrite,
Reads all bytes into any type that can be extended by a reader. This is more generic than the case of std::io
and might enable some optimizations. Read more
fn by_ref(&mut self) -> &mut Self where
Self: Sized,
Self: Sized,
Creates a "by reference" adaptor for this instance of Read
. Read more
impl<W> Write for Restarting<W> where
W: Write,
W::WriteError: IntoIntrError,
W::FlushError: IntoIntrError,
[src]
W: Write,
W::WriteError: IntoIntrError,
W::FlushError: IntoIntrError,
type WriteError = <<W as Write>::WriteError as IntoIntrError>::NonIntr
Value of this type is returned when write()
fails. Read more
type FlushError = <<W as Write>::FlushError as IntoIntrError>::NonIntr
Value of this type is returned when flush()
fails. In case of low-level writers flush often does nothing and therefore doesn't return error, so this type might be Void. Read more
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::WriteError>
Write a buffer into this object, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<(), Self::FlushError>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
fn size_hint(&mut self, min: usize, max: Option<usize>)
Hints the writer how much bytes will be written after call to this function. At least min
bytes should be written after the call to this function and if max
is Some(x)
than at most x
bytes should be written. Read more
fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::WriteError>
Attempts to write an entire buffer into this Write
.