pub struct StreamId(u32);
Expand description
A stream identifier, as described in Section 5.1.1 of RFC 7540.
Streams are identified with an unsigned 31-bit integer. Streams initiated by a client MUST use odd-numbered stream identifiers; those initiated by the server MUST use even-numbered stream identifiers. A stream identifier of zero (0x0) is used for connection control messages; the stream identifier of zero cannot be used to establish a new stream.
Tuple Fields§
§0: u32
Implementations§
source§impl StreamId
impl StreamId
sourcepub fn is_client_initiated(&self) -> bool
pub fn is_client_initiated(&self) -> bool
Returns true if this stream ID corresponds to a stream that was initiated by the client.
sourcepub fn is_server_initiated(&self) -> bool
pub fn is_server_initiated(&self) -> bool
Returns true if this stream ID corresponds to a stream that was initiated by the server.
sourcepub fn next_id(&self) -> Result<StreamId, StreamIdOverflow>
pub fn next_id(&self) -> Result<StreamId, StreamIdOverflow>
Returns the next stream ID initiated by the same peer as this stream ID, or an error if incrementing this stream ID would overflow the maximum.
Trait Implementations§
source§impl Ord for StreamId
impl Ord for StreamId
source§impl PartialEq for StreamId
impl PartialEq for StreamId
source§impl PartialOrd for StreamId
impl PartialOrd for StreamId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for StreamId
impl Eq for StreamId
impl StructuralPartialEq for StreamId
Auto Trait Implementations§
impl Freeze for StreamId
impl RefUnwindSafe for StreamId
impl Send for StreamId
impl Sync for StreamId
impl Unpin for StreamId
impl UnwindSafe for StreamId
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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.