pub struct StreamTable { /* private fields */ }Expand description
Tracks active streams and their current state for a single connection.
Implementations§
Source§impl StreamTable
impl StreamTable
Sourcepub fn insert(
&mut self,
stream_id: StreamId,
state: StreamState,
) -> Result<(), ProtocolError>
pub fn insert( &mut self, stream_id: StreamId, state: StreamState, ) -> Result<(), ProtocolError>
Insert a new active stream in the requested state.
§Errors
Returns ProtocolError::CodecError when the stream already exists in
the table.
Sourcepub fn transition(
&mut self,
stream_id: StreamId,
new_state: StreamState,
) -> Result<(), ProtocolError>
pub fn transition( &mut self, stream_id: StreamId, new_state: StreamState, ) -> Result<(), ProtocolError>
Transition an existing stream to a new state.
§Errors
Returns ProtocolError::CodecError when the stream is not present in
the table.
Sourcepub fn remove(&mut self, stream_id: StreamId) -> Option<StreamState>
pub fn remove(&mut self, stream_id: StreamId) -> Option<StreamState>
Remove a stream from the table and return its previous state.
Sourcepub fn get(&self, stream_id: StreamId) -> Option<StreamState>
pub fn get(&self, stream_id: StreamId) -> Option<StreamState>
Return the tracked state for a stream.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Return the number of streams currently tracked in the table.
Trait Implementations§
Source§impl Debug for StreamTable
impl Debug for StreamTable
Source§impl Default for StreamTable
impl Default for StreamTable
Source§fn default() -> StreamTable
fn default() -> StreamTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StreamTable
impl RefUnwindSafe for StreamTable
impl Send for StreamTable
impl Sync for StreamTable
impl Unpin for StreamTable
impl UnsafeUnpin for StreamTable
impl UnwindSafe for StreamTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more