Trait genio::ExtendFromReaderSlow [] [src]

pub trait ExtendFromReaderSlow {
    type ExtendError;
    fn extend_from_reader_slow<R: Read + ?Sized>(
        &mut self,
        reader: &mut R
    ) -> Result<usize, ExtendError<R::ReadError, Self::ExtendError>>; }

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

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

This method performs extending from reader - that means calling read() just once.

Implementors