Struct solicit::http::session::DefaultStream [] [src]

pub struct DefaultStream {
    pub stream_id: StreamId,
    pub headers: Option<Vec<Header>>,
    pub body: Vec<u8>,
    pub state: StreamState,
    // some fields omitted
}

An implementation of the Stream trait that saves all headers and data in memory.

Stores its outgoing data as a Vec<u8>.

Fields

stream_id

The ID of the stream

headers

The headers associated with the stream (i.e. the response headers)

body

The body of the stream (i.e. the response body)

state

The current stream state.

Methods

impl DefaultStream

fn new(stream_id: StreamId) -> DefaultStream

Create a new DefaultStream with the given ID.

fn set_full_data(&mut self, data: Vec<u8>)

Sets the outgoing data of the stream to the given Vec.

Any previously associated (and perhaps unwritten) data is discarded.

Trait Implementations

impl Stream for DefaultStream

fn new(stream_id: StreamId) -> DefaultStream

fn new_data_chunk(&mut self, data: &[u8])

fn set_headers(&mut self, headers: Vec<Header>)

fn set_state(&mut self, state: StreamState)

fn id(&self) -> StreamId

fn state(&self) -> StreamState

fn get_data_chunk(&mut self, buf: &mut [u8]) -> Result<StreamDataChunk, StreamDataError>

fn close(&mut self)

fn close_local(&mut self)

fn close_remote(&mut self)

fn is_closed(&self) -> bool

fn is_closed_local(&self) -> bool

fn is_closed_remote(&self) -> bool

Derived Implementations

impl Clone for DefaultStream

fn clone(&self) -> DefaultStream

1.0.0fn clone_from(&mut self, source: &Self)