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: StreamId
The ID of the stream
headers: Option<Vec<Header>>
The headers associated with the stream (i.e. the response headers)
body: Vec<u8>
The body of the stream (i.e. the response body)
state: StreamState
The current stream state.
Methods
impl DefaultStream[src]
impl DefaultStreampub fn new(stream_id: StreamId) -> DefaultStream[src]
pub fn new(stream_id: StreamId) -> DefaultStreamCreate a new DefaultStream with the given ID.
pub fn set_full_data(&mut self, data: Vec<u8>)[src]
pub 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 Clone for DefaultStream[src]
impl Clone for DefaultStreamfn clone(&self) -> DefaultStream[src]
fn clone(&self) -> DefaultStreamReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Stream for DefaultStream[src]
impl Stream for DefaultStreamfn new(stream_id: StreamId) -> DefaultStream[src]
fn new(stream_id: StreamId) -> DefaultStreamCreate a new stream with the given ID
fn new_data_chunk(&mut self, data: &[u8])[src]
fn new_data_chunk(&mut self, data: &[u8])Handle a new data chunk that has arrived for the stream.
fn set_headers(&mut self, headers: Vec<Header>)[src]
fn set_headers(&mut self, headers: Vec<Header>)Set headers for a stream. A stream is only allowed to have one set of headers. Read more
fn set_state(&mut self, state: StreamState)[src]
fn set_state(&mut self, state: StreamState)Sets the stream state to the newly provided state.
fn id(&self) -> StreamId[src]
fn id(&self) -> StreamIdReturns the ID of the stream.
fn state(&self) -> StreamState[src]
fn state(&self) -> StreamStateReturns the current state of the stream.
fn get_data_chunk(
&mut self,
buf: &mut [u8]
) -> Result<StreamDataChunk, StreamDataError>[src]
fn get_data_chunk(
&mut self,
buf: &mut [u8]
) -> Result<StreamDataChunk, StreamDataError>Places the next data chunk that should be written onto the stream into the given buffer. Read more
fn close(&mut self)[src]
fn close(&mut self)Transitions the stream state to closed. After this, the stream is considered to be closed for any further reads or writes. Read more
fn close_local(&mut self)[src]
fn close_local(&mut self)Updates the Stream status to indicate that it is closed locally. Read more
fn close_remote(&mut self)[src]
fn close_remote(&mut self)Updates the Stream status to indicate that it is closed on the remote peer's side. Read more
fn is_closed(&self) -> bool[src]
fn is_closed(&self) -> boolReturns whether the stream is closed. Read more
fn is_closed_local(&self) -> bool[src]
fn is_closed_local(&self) -> boolReturns whether the stream is closed locally.
fn is_closed_remote(&self) -> bool[src]
fn is_closed_remote(&self) -> boolReturns whether the remote peer has closed the stream. This includes a fully closed stream.
Auto Trait Implementations
impl Send for DefaultStream
impl Send for DefaultStreamimpl Sync for DefaultStream
impl Sync for DefaultStream