Skip to main content

net_wire/http3/
ids.rs

1//! HTTP/3 protocol identifiers.
2
3/// An HTTP/3 push identifier without semantic validation.
4#[repr(transparent)]
5#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
6pub struct Http3PushId(u64);
7
8impl Http3PushId {
9    /// Creates a raw push identifier.
10    pub const fn new(value: u64) -> Self {
11        Self(value)
12    }
13
14    /// Returns the raw push identifier value.
15    pub const fn value(self) -> u64 {
16        self.0
17    }
18}
19
20/// An HTTP/3 stream identifier without semantic validation.
21#[repr(transparent)]
22#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
23pub struct Http3StreamId(u64);
24
25impl Http3StreamId {
26    /// Creates a raw stream identifier.
27    pub const fn new(value: u64) -> Self {
28        Self(value)
29    }
30
31    /// Returns the raw stream identifier value.
32    pub const fn value(self) -> u64 {
33        self.0
34    }
35}