[−][src]Trait genio::ExtendFromReaderSlow
Some types can be extended by reading from reader. The most well-known is probably Vec
. It
is possible to implement it manually, but it may be more efficient if the type implements this
trait directly. In case of Vec
, it means reading directly into uninitialized part of reserved
memory in case of the fast version of this trait.
Associated Types
type ExtendError
This type is returned when extending fails. For example, if not enough memory could be allocated. All other errors should be passed directly from reader.
Required methods
fn extend_from_reader_slow<R: Read + ?Sized>(
&mut self,
reader: &mut R
) -> Result<usize, ExtendError<R::ReadError, Self::ExtendError>>
&mut self,
reader: &mut R
) -> Result<usize, ExtendError<R::ReadError, Self::ExtendError>>
This method performs extending from reader - that means calling read()
just once.
Implementations on Foreign Types
impl ExtendFromReaderSlow for Vec<u8>
[src]
type ExtendError = Void
fn extend_from_reader_slow<R: Read + ?Sized>(
&mut self,
reader: &mut R
) -> Result<usize, ExtendError<R::ReadError, Self::ExtendError>>
[src]
&mut self,
reader: &mut R
) -> Result<usize, ExtendError<R::ReadError, Self::ExtendError>>