[−][src]Struct solicit::http::session::DefaultStream
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 DefaultStream
pub fn new(stream_id: StreamId) -> DefaultStream
[src]
pub fn new(stream_id: StreamId) -> DefaultStream
Create 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 Stream for DefaultStream
[src]
impl Stream for DefaultStream
fn new(stream_id: StreamId) -> DefaultStream
[src]
fn new(stream_id: StreamId) -> DefaultStream
Create 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) -> StreamId
Returns the ID of the stream.
fn state(&self) -> StreamState
[src]
fn state(&self) -> StreamState
Returns 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) -> bool
Returns whether the stream is closed. Read more
fn is_closed_local(&self) -> bool
[src]
fn is_closed_local(&self) -> bool
Returns whether the stream is closed locally.
fn is_closed_remote(&self) -> bool
[src]
fn is_closed_remote(&self) -> bool
Returns whether the remote peer has closed the stream. This includes a fully closed stream.
impl Clone for DefaultStream
[src]
impl Clone for DefaultStream
fn clone(&self) -> DefaultStream
[src]
fn clone(&self) -> DefaultStream
Returns 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
Auto Trait Implementations
impl Send for DefaultStream
impl Send for DefaultStream
impl Sync for DefaultStream
impl Sync for DefaultStream
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more