Make StreamId::new public
This is useful for calculating a GoAway(x) value without duplicating the
code.
@@ -176,7 +176,8 @@ impl fmt::Display for StreamId {
}
impl StreamId {
- pub(crate) fn new(initiator: Side, dir: Dir, index: u64) -> Self {
+ /// Create a new StreamId
+ pub fn new(initiator: Side, dir: Dir, index: u64) -> Self {
StreamId(index << 2 | (dir as u64) << 1 | initiator as u64)
}
/// Which side of a connection initiated the stream
