pub struct StreamId(/* private fields */);Expand description
Streams are identified within a connection by a numeric value, referred to as the stream ID.
A stream ID is a 62-bit integer (0 to 262-1) that is unique for all streams on a connection.
Stream IDs are encoded as VarInt.
A QUIC endpoint MUST NOT reuse a stream ID within a connection.
There are four types of streams in QUIC, divided according to the role and direction of the stream. See Stream ID Types of QUIC for more details.
Implementations§
Source§impl StreamId
impl StreamId
Sourcepub fn new(role: Role, dir: Dir, id: u64) -> StreamId
pub fn new(role: Role, dir: Dir, id: u64) -> StreamId
Create a new stream ID with the given role, direction, and ID.
It is prohibited to directly create a StreamId from external sources. StreamId can only be allocated incrementally by proactively creating new streams locally. or accepting new streams opened by peer.
Sourcepub fn id(&self) -> u64
pub fn id(&self) -> u64
Get the actual ID of this stream, removing the lowest 2 bits for direction and role.
Sourcepub fn encoding_size(&self) -> usize
pub fn encoding_size(&self) -> usize
Return the encoding size of this stream ID.
Trait Implementations§
Source§impl Ord for StreamId
impl Ord for StreamId
Source§impl PartialOrd for StreamId
impl PartialOrd for StreamId
impl 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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)