pub struct StreamId(_);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.
Implementations
sourceimpl StreamId
impl StreamId
sourcepub const fn is_client_initiated(&self) -> bool
pub const fn is_client_initiated(&self) -> bool
Returns true if this stream ID corresponds to a stream that was initiated by the client.
sourcepub const fn is_server_initiated(&self) -> bool
pub const fn is_server_initiated(&self) -> bool
Returns true if this stream ID corresponds to a stream that was initiated by the server.
sourcepub const fn next_id(&self) -> Result<StreamId, StreamIdOverflow>
pub const 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
sourceimpl Ord for StreamId
impl Ord for StreamId
sourceimpl PartialOrd<StreamId> for StreamId
impl PartialOrd<StreamId> for StreamId
sourcefn partial_cmp(&self, other: &StreamId) -> Option<Ordering>
fn partial_cmp(&self, other: &StreamId) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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 more
impl Copy for StreamId
impl Eq for StreamId
impl StructuralEq for StreamId
impl StructuralPartialEq for StreamId
Auto Trait Implementations
impl RefUnwindSafe for StreamId
impl Send for StreamId
impl Sync for StreamId
impl Unpin for StreamId
impl UnwindSafe for StreamId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more