s2n_quic_core/frame/
stream_data_blocked.rs

1// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4use crate::varint::VarInt;
5
6//= https://www.rfc-editor.org/rfc/rfc9000#section-19.13
7//# This frame is analogous to DATA_BLOCKED (Section 19.12).
8
9macro_rules! stream_data_blocked_tag {
10    () => {
11        0x15u8
12    };
13}
14
15//= https://www.rfc-editor.org/rfc/rfc9000#section-19.13
16//# STREAM_DATA_BLOCKED Frame {
17//#   Type (i) = 0x15,
18//#   Stream ID (i),
19//#   Maximum Stream Data (i),
20//# }
21
22//= https://www.rfc-editor.org/rfc/rfc9000#section-19.13
23//# STREAM_DATA_BLOCKED frames contain the following fields:
24//#
25//# Stream ID:  A variable-length integer indicating the stream that is
26//#    blocked due to flow control.
27//#
28//# Maximum Stream Data:  A variable-length integer indicating the offset
29//#    of the stream at which the blocking occurred.
30
31#[derive(Copy, Clone, Debug, PartialEq, Eq)]
32pub struct StreamDataBlocked {
33    /// A variable-length integer indicating the stream which
34    /// is flow control blocked.
35    pub stream_id: VarInt,
36
37    /// A variable-length integer indicating the offset of the stream at
38    // which the blocking occurred.
39    pub stream_data_limit: VarInt,
40}
41
42impl StreamDataBlocked {
43    pub const fn tag(&self) -> u8 {
44        stream_data_blocked_tag!()
45    }
46}
47
48simple_frame_codec!(
49    StreamDataBlocked {
50        stream_id,
51        stream_data_limit
52    },
53    stream_data_blocked_tag!()
54);