Crate rotor_stream [] [src]

Stream abstraction for rotor

Assumptions:

  1. You read data by length-prefixed or fixed-string-delimited chunks rather than byte-by-byte
  2. Each chunk fits memory
  3. Your data stream is not entirely full-duplex: while you can read and write simultaneously, when you apply pushback (i.e. waiting for bytes to be flushed), you can't do reads [*]

[*] This matches HTTP perfectly, and most bidirectional interactive workflows (including based on websockets). But for some cases may be hard to implement. One such case is when you need to generate some output stream (you can't buffer it), and have to parse input stream at the same time.

Structs

Buf

A buffer object to be used for reading from network

Stream
Transport

Enums

Accept

Socket acceptor State Machine

Exception
Expectation

Constants

MAX_BUF_SIZE

Maximum size of buffer allowed. Note: we assert on this size. Most network servers should set their own limits to something much smaller.

Traits

Accepted
Protocol
StreamSocket

Type Definitions

Deadline
Request