requests.streams

  • Declaration

    interface DataPipeIface(E);

    DataPipeIface can accept some data, process, and return processed data.

    • Declaration

      bool empty();

      Is there any processed data ready for reading?

    • Declaration

      void putNoCopy(E[]);

      Put next data portion for processing

    • get

      Declaration

      E[] get();

      Get any ready data

    • Declaration

      void flush();

      Signal on end of incoming data stream.

  • Declaration

    class DataPipe(E): DataPipeIface!E;

    DataPipe is a pipeline of data processors, each accept some data, process it, and put result to next element in line. This class used to combine different Transfer- and Content- encodings. For example: unchunk transfer-encoding "chunnked", and uncompress Content-Encoding "gzip".

    • Declaration

      final void insert(DataPipeIface!E p);

      Append data processor to pipeline

      Parameters

      DataPipeIface!E p

      processor

    • Declaration

      final void putNoCopy(E[] data);

      Process next data portion. Data passed over pipeline and store result in buffer.

      Parameters

      E[] data

      input data buffer. NoCopy means we do not copy data to buffer, we keep reference

    • get

      Declaration

      final E[] get();

      Get what was collected in internal buffer and clear it.

      Return Value

      data collected.

    • Declaration

      final E[][] getNoCopy();

      get without datamove. but user receive [][]

    • Declaration

      final const pure @safe bool empty();

      Test if internal buffer is empty

      Return Value

      true if internal buffer is empty (nothing to get())

  • Declaration

    class Decompressor(E): DataPipeIface!E;

    Processor for gzipped/compressed content. Also support InputRange interface.

  • Declaration

    class DecodeChunked: requests.streams.DataPipeIface!ubyte.DataPipeIface;

    Unchunk chunked http responce body.