e621stream 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +35 -0
  4. data/lib/e621stream/client/options.rb +20 -0
  5. data/lib/e621stream/client.rb +211 -0
  6. data/lib/e621stream/close_codes.rb +23 -0
  7. data/lib/e621stream/event.rb +24 -0
  8. data/lib/e621stream/events.rb +29 -0
  9. data/lib/e621stream/stream_error.rb +18 -0
  10. data/lib/e621stream/version.rb +5 -0
  11. data/lib/e621stream.rb +18 -0
  12. data/sorbet/config +6 -0
  13. data/sorbet/rbi/annotations/.gitattributes +1 -0
  14. data/sorbet/rbi/annotations/minitest.rbi +120 -0
  15. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  16. data/sorbet/rbi/gems/.gitattributes +1 -0
  17. data/sorbet/rbi/gems/ast@2.4.3.rbi +550 -0
  18. data/sorbet/rbi/gems/async-http@0.105.0.rbi +1649 -0
  19. data/sorbet/rbi/gems/async-pool@0.12.0.rbi +219 -0
  20. data/sorbet/rbi/gems/async-websocket@0.30.2.rbi +271 -0
  21. data/sorbet/rbi/gems/async@2.46.0.rbi +2193 -0
  22. data/sorbet/rbi/gems/benchmark@0.5.0.rbi +495 -0
  23. data/sorbet/rbi/gems/console@1.38.0.rbi +1552 -0
  24. data/sorbet/rbi/gems/erb@6.0.7.rbi +1581 -0
  25. data/sorbet/rbi/gems/erubi@1.13.1.rbi +153 -0
  26. data/sorbet/rbi/gems/fiber-annotation@0.2.0.rbi +62 -0
  27. data/sorbet/rbi/gems/fiber-local@1.1.0.rbi +36 -0
  28. data/sorbet/rbi/gems/fiber-storage@1.0.1.rbi +43 -0
  29. data/sorbet/rbi/gems/io-console@0.9.5.rbi +9 -0
  30. data/sorbet/rbi/gems/io-endpoint@0.19.0.rbi +1079 -0
  31. data/sorbet/rbi/gems/io-event@1.22.3.rbi +971 -0
  32. data/sorbet/rbi/gems/io-stream@0.14.0.rbi +805 -0
  33. data/sorbet/rbi/gems/json@3.1.0.rbi +1929 -0
  34. data/sorbet/rbi/gems/language_server-protocol@3.17.0.6.rbi +9 -0
  35. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
  36. data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
  37. data/sorbet/rbi/gems/minitest@5.27.0.rbi +1499 -0
  38. data/sorbet/rbi/gems/netrc@0.11.0.rbi +147 -0
  39. data/sorbet/rbi/gems/openssl@4.0.2.rbi +4366 -0
  40. data/sorbet/rbi/gems/parallel@2.3.0.rbi +332 -0
  41. data/sorbet/rbi/gems/parser@3.3.13.0.rbi +5146 -0
  42. data/sorbet/rbi/gems/pp@0.6.4.rbi +373 -0
  43. data/sorbet/rbi/gems/prettyprint@0.2.1.rbi +476 -0
  44. data/sorbet/rbi/gems/prism@1.9.0.rbi +42213 -0
  45. data/sorbet/rbi/gems/protocol-hpack@1.5.1.rbi +418 -0
  46. data/sorbet/rbi/gems/protocol-http1@0.41.1.rbi +894 -0
  47. data/sorbet/rbi/gems/protocol-http2@0.29.2.rbi +2277 -0
  48. data/sorbet/rbi/gems/protocol-http@0.72.1.rbi +3801 -0
  49. data/sorbet/rbi/gems/protocol-rack@0.23.0.rbi +9 -0
  50. data/sorbet/rbi/gems/protocol-url@0.19.0.rbi +9 -0
  51. data/sorbet/rbi/gems/protocol-websocket@0.21.3.rbi +1087 -0
  52. data/sorbet/rbi/gems/racc@1.8.1.rbi +169 -0
  53. data/sorbet/rbi/gems/rack@3.2.8.rbi +9 -0
  54. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +362 -0
  55. data/sorbet/rbi/gems/rake@13.4.2.rbi +3127 -0
  56. data/sorbet/rbi/gems/rbi@0.5.0.rbi +5875 -0
  57. data/sorbet/rbi/gems/rbs@4.2.0.rbi +7133 -0
  58. data/sorbet/rbi/gems/rdoc@8.1.0.rbi +9 -0
  59. data/sorbet/rbi/gems/regexp_parser@2.13.1.rbi +3500 -0
  60. data/sorbet/rbi/gems/reline@0.7.0.rbi +2449 -0
  61. data/sorbet/rbi/gems/require-hooks@0.5.1.rbi +152 -0
  62. data/sorbet/rbi/gems/rexml@3.4.4.rbi +4905 -0
  63. data/sorbet/rbi/gems/rubocop-ast@1.51.0.rbi +7230 -0
  64. data/sorbet/rbi/gems/rubocop-rake@0.7.1.rbi +314 -0
  65. data/sorbet/rbi/gems/rubocop@1.92.2.rbi +69094 -0
  66. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
  67. data/sorbet/rbi/gems/rubydex@0.4.4.rbi +1620 -0
  68. data/sorbet/rbi/gems/spoom@1.8.13.rbi +7380 -0
  69. data/sorbet/rbi/gems/tapioca@0.20.0.rbi +3752 -0
  70. data/sorbet/rbi/gems/thor@1.5.0.rbi +3870 -0
  71. data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
  72. data/sorbet/rbi/gems/unicode-display_width@3.3.0.rbi +130 -0
  73. data/sorbet/rbi/gems/unicode-emoji@4.3.0.rbi +254 -0
  74. data/sorbet/rbi/gems/zeitwerk@2.8.3.rbi +1178 -0
  75. data/sorbet/tapioca/config.yml +13 -0
  76. data/sorbet/tapioca/require.rb +4 -0
  77. metadata +175 -0
@@ -0,0 +1,2277 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `protocol-http2` gem.
5
+ # Please instead update this file by running `bin/tapioca gem protocol-http2`.
6
+
7
+
8
+ # @namespace
9
+ # Released under the MIT License.
10
+ # Copyright, 2024-2025, by Samuel Williams.
11
+ #
12
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:8
13
+ module Protocol; end
14
+
15
+ # @namespace
16
+ #
17
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:9
18
+ module Protocol::HTTP2; end
19
+
20
+ # pkg:gem/protocol-http2#lib/protocol/http2/ping_frame.rb:10
21
+ Protocol::HTTP2::ACKNOWLEDGEMENT = T.let(T.unsafe(nil), Integer)
22
+
23
+ # Provides acknowledgement functionality for frames that support it.
24
+ # This module handles setting and checking acknowledgement flags on frames.
25
+ #
26
+ # pkg:gem/protocol-http2#lib/protocol/http2/ping_frame.rb:14
27
+ module Protocol::HTTP2::Acknowledgement
28
+ # Create an acknowledgement frame for this frame.
29
+ # @returns [Frame] A new frame marked as an acknowledgement.
30
+ #
31
+ # pkg:gem/protocol-http2#lib/protocol/http2/ping_frame.rb:28
32
+ def acknowledge; end
33
+
34
+ # Mark this frame as an acknowledgement.
35
+ #
36
+ # pkg:gem/protocol-http2#lib/protocol/http2/ping_frame.rb:22
37
+ def acknowledgement!; end
38
+
39
+ # Check if the frame is an acknowledgement.
40
+ # @returns [Boolean] True if the acknowledgement flag is set.
41
+ #
42
+ # pkg:gem/protocol-http2#lib/protocol/http2/ping_frame.rb:17
43
+ def acknowledgement?; end
44
+ end
45
+
46
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:18
47
+ Protocol::HTTP2::CANCEL = T.let(T.unsafe(nil), Integer)
48
+
49
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:19
50
+ Protocol::HTTP2::COMPRESSION_ERROR = T.let(T.unsafe(nil), Integer)
51
+
52
+ # Default connection "fast-fail" preamble string as defined by the spec.
53
+ #
54
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:43
55
+ Protocol::HTTP2::CONNECTION_PREFACE = T.let(T.unsafe(nil), String)
56
+
57
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:20
58
+ Protocol::HTTP2::CONNECT_ERROR = T.let(T.unsafe(nil), Integer)
59
+
60
+ # Represents an HTTP/2 client connection.
61
+ # Manages client-side protocol semantics including stream ID allocation,
62
+ # connection preface handling, and push promise processing.
63
+ #
64
+ # pkg:gem/protocol-http2#lib/protocol/http2/client.rb:13
65
+ class Protocol::HTTP2::Client < ::Protocol::HTTP2::Connection
66
+ # Initialize a new HTTP/2 client connection.
67
+ # @parameter framer [Framer] The frame handler for reading/writing HTTP/2 frames.
68
+ #
69
+ # pkg:gem/protocol-http2#lib/protocol/http2/client.rb:16
70
+ def initialize(framer); end
71
+
72
+ # Clients cannot create push promise streams.
73
+ # @raises [ProtocolError] Always, as clients cannot initiate push promises.
74
+ #
75
+ # pkg:gem/protocol-http2#lib/protocol/http2/client.rb:69
76
+ def create_push_promise_stream; end
77
+
78
+ # Check if the given stream ID represents a locally-initiated stream.
79
+ # Client streams have odd numbered IDs.
80
+ # @parameter id [Integer] The stream ID to check.
81
+ # @returns [bool] True if the stream ID is locally-initiated.
82
+ #
83
+ # pkg:gem/protocol-http2#lib/protocol/http2/client.rb:24
84
+ def local_stream_id?(id); end
85
+
86
+ # Process a push promise frame received from the server.
87
+ # @parameter frame [PushPromiseFrame] The push promise frame to process.
88
+ # @returns [Array(Stream, Hash) | Nil] The promised stream and request headers, or nil if no associated stream.
89
+ #
90
+ # pkg:gem/protocol-http2#lib/protocol/http2/client.rb:76
91
+ def receive_push_promise(frame); end
92
+
93
+ # Check if the given stream ID represents a remotely-initiated stream.
94
+ # Server streams have even numbered IDs.
95
+ # @parameter id [Integer] The stream ID to check.
96
+ # @returns [bool] True if the stream ID is remotely-initiated.
97
+ #
98
+ # pkg:gem/protocol-http2#lib/protocol/http2/client.rb:32
99
+ def remote_stream_id?(id); end
100
+
101
+ # Send the HTTP/2 connection preface and initial settings.
102
+ # This must be called once when the connection is first established.
103
+ # @parameter settings [Array] Optional settings to send with the connection preface.
104
+ # @raises [ProtocolError] If called when not in the new state.
105
+ # @yields Allows custom processing during preface exchange.
106
+ #
107
+ # pkg:gem/protocol-http2#lib/protocol/http2/client.rb:49
108
+ def send_connection_preface(settings = T.unsafe(nil)); end
109
+
110
+ # Check if the given stream ID is valid for remote initiation.
111
+ # Server-initiated streams must have even numbered IDs.
112
+ # @parameter stream_id [Integer] The stream ID to validate.
113
+ # @returns [bool] True if the stream ID is valid for remote initiation.
114
+ #
115
+ # pkg:gem/protocol-http2#lib/protocol/http2/client.rb:40
116
+ def valid_remote_stream_id?(stream_id); end
117
+ end
118
+
119
+ # This is the core connection class that handles HTTP/2 protocol semantics including
120
+ # stream management, settings negotiation, and frame processing.
121
+ #
122
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:19
123
+ class Protocol::HTTP2::Connection
124
+ include ::Protocol::HTTP2::FlowControlled
125
+
126
+ # Initialize a new HTTP/2 connection.
127
+ # @parameter framer [Framer] The frame handler for reading/writing HTTP/2 frames.
128
+ # @parameter local_stream_id [Integer] The starting stream ID for locally-initiated streams.
129
+ #
130
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:25
131
+ def initialize(framer, local_stream_id); end
132
+
133
+ # Access streams by ID, with 0 returning the connection itself.
134
+ # @parameter id [Integer] The stream ID to look up.
135
+ # @returns [Connection | Stream | Nil] The connection (if id=0), stream, or nil.
136
+ #
137
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:63
138
+ def [](id); end
139
+
140
+ # Accept an incoming push promise from the other side of the connection.
141
+ # On the client side, we accept push promise streams.
142
+ # On the server side, existing streams create push promise streams.
143
+ #
144
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:472
145
+ def accept_push_promise_stream(stream_id, &block); end
146
+
147
+ # Accept an incoming stream from the other side of the connnection.
148
+ # On the server side, we accept requests.
149
+ #
150
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:461
151
+ def accept_stream(stream_id, &block); end
152
+
153
+ # Check if the given stream ID represents a client-initiated stream.
154
+ # Client streams always have odd numbered IDs.
155
+ # @parameter id [Integer] The stream ID to check.
156
+ # @returns [Boolean] True if the stream ID is client-initiated.
157
+ #
158
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:567
159
+ def client_stream_id?(id); end
160
+
161
+ # Close the underlying framer and all streams.
162
+ #
163
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:140
164
+ def close(error = T.unsafe(nil)); end
165
+
166
+ # Transition the connection into the closed state.
167
+ #
168
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:245
169
+ def close!; end
170
+
171
+ # Transition the connection into the closed state if a graceful GOAWAY was received and there is nothing left to drain.
172
+ #
173
+ # As with {close!}, this is a state transition only: the owner of the connection is responsible for closing the underlying framer.
174
+ #
175
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:119
176
+ def close_if_drained!; end
177
+
178
+ # Whether the connection is effectively or actually closed.
179
+ #
180
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:106
181
+ def closed?; end
182
+
183
+ # This is only valid if the stream doesn't exist in `@streams`.
184
+ #
185
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:601
186
+ def closed_stream_id?(id); end
187
+
188
+ # Traverse active streams and allow them to consume the available flow-control window.
189
+ # @parameter amount [Integer] the amount of data to write. Defaults to the current window capacity.
190
+ #
191
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:627
192
+ def consume_window(size = T.unsafe(nil)); end
193
+
194
+ # Create a push promise stream.
195
+ # This method should be overridden by client/server implementations.
196
+ # @yields {|stream| ...} Optional block to configure the created stream.
197
+ # @returns [Stream] The created push promise stream.
198
+ #
199
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:500
200
+ def create_push_promise_stream(&block); end
201
+
202
+ # Create a stream, defaults to an outgoing stream.
203
+ # On the client side, we create requests.
204
+ # @return [Stream] the created stream.
205
+ #
206
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:479
207
+ def create_stream(id = T.unsafe(nil), &block); end
208
+
209
+ # Decode headers using HPACK decompression.
210
+ # @parameter data [String] The encoded header block data.
211
+ # @returns [Array] The decoded headers.
212
+ #
213
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:169
214
+ def decode_headers(data); end
215
+
216
+ # Remove a stream from the active streams collection.
217
+ #
218
+ # If the remote peer has sent a graceful GOAWAY frame, the connection is only kept open in order to drain the streams it accepted, so when the last one completes there is nothing left to read.
219
+ #
220
+ # @parameter id [Integer] The stream ID to remove.
221
+ # @returns [Stream | Nil] The removed stream, or nil if not found.
222
+ #
223
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:131
224
+ def delete(id); end
225
+
226
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:184
227
+ def dependencies; end
228
+
229
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:186
230
+ def dependency; end
231
+
232
+ # Encode headers using HPACK compression.
233
+ # @parameter headers [Array] The headers to encode.
234
+ # @parameter buffer [String] Optional buffer for encoding output.
235
+ # @returns [String] The encoded header block.
236
+ #
237
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:162
238
+ def encode_headers(headers, buffer = T.unsafe(nil)); end
239
+
240
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:83
241
+ def framer; end
242
+
243
+ # Whether the remote peer has sent us a GOAWAY frame. We must not initiate any new streams on this connection, but existing streams may still be in progress.
244
+ # @returns [Boolean] True if a GOAWAY frame has been received.
245
+ #
246
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:112
247
+ def goaway_received?; end
248
+
249
+ # The lowest Last-Stream-ID received in a GOAWAY frame.
250
+ #
251
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:103
252
+ def goaway_stream_id; end
253
+
254
+ # The connection stream ID (always 0 for connection-level operations).
255
+ # @returns [Integer] Always returns 0 for the connection itself.
256
+ #
257
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:56
258
+ def id; end
259
+
260
+ # Check if the given stream ID represents an idle stream.
261
+ # @parameter id [Integer] The stream ID to check.
262
+ # @returns [Boolean] True if the stream ID is idle (not yet used).
263
+ #
264
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:582
265
+ def idle_stream_id?(id); end
266
+
267
+ # 6.8. GOAWAY
268
+ # There is an inherent race condition between an endpoint starting new streams and the remote sending a GOAWAY frame. To deal with this case, the GOAWAY contains the stream identifier of the last peer-initiated stream that was or might be processed on the sending endpoint in this connection. For instance, if the server sends a GOAWAY frame, the identified stream is the highest-numbered stream initiated by the client.
269
+ # Once sent, the sender will ignore frames sent on streams initiated by the receiver if the stream has an identifier higher than the included last stream identifier. Receivers of a GOAWAY frame MUST NOT open additional streams on the connection, although a new connection can be established for new streams.
270
+ #
271
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:191
272
+ def ignore_frame?(frame); end
273
+
274
+ # Current settings value for local and peer
275
+ #
276
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:89
277
+ def local_settings; end
278
+
279
+ # Current settings value for local and peer
280
+ #
281
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:89
282
+ def local_settings=(_arg0); end
283
+
284
+ # Check if the given stream ID represents a locally-initiated stream.
285
+ # This method should be overridden by client/server implementations.
286
+ # @parameter id [Integer] The stream ID to check.
287
+ # @returns [Boolean] True if the stream ID is locally-initiated.
288
+ #
289
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:455
290
+ def local_stream_id?(id); end
291
+
292
+ # Our window for receiving data. When we receive data, it reduces this window.
293
+ # If the window gets too small, we must send a window update.
294
+ #
295
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:94
296
+ def local_window; end
297
+
298
+ # The maximum number of concurrent streams that this connection can initiate. This is a setting that can be changed by the remote peer.
299
+ #
300
+ # It is not the same as the number of streams that can be accepted by the connection. The number of streams that can be accepted is determined by the local settings, and the number of streams that can be initiated is determined by the remote settings.
301
+ #
302
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:79
303
+ def maximum_concurrent_streams; end
304
+
305
+ # The size of a frame payload is limited by the maximum size that a receiver advertises in the SETTINGS_MAX_FRAME_SIZE setting.
306
+ #
307
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:72
308
+ def maximum_frame_size; end
309
+
310
+ # 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.
311
+ #
312
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:174
313
+ def next_stream_id; end
314
+
315
+ # Transition the connection to the open state.
316
+ # @returns [Connection] Self for method chaining.
317
+ #
318
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:375
319
+ def open!; end
320
+
321
+ # In addition to changing the flow-control window for streams that are not yet active, a SETTINGS frame can alter the initial flow-control window size for streams with active flow-control windows (that is, streams in the "open" or "half-closed (remote)" state). When the value of SETTINGS_INITIAL_WINDOW_SIZE changes, a receiver MUST adjust the size of all stream flow-control windows that it maintains by the difference between the new value and the old value.
322
+ #
323
+ # @return [Boolean] whether the frame was an acknowledgement
324
+ #
325
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:350
326
+ def process_settings(frame); end
327
+
328
+ # Reads one frame from the network and processes. Processing the frame updates the state of the connection and related streams. If the frame triggers an error, e.g. a protocol error, the connection will typically emit a goaway frame and re-raise the exception. You should continue processing frames until the underlying connection is closed.
329
+ #
330
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:208
331
+ def read_frame; end
332
+
333
+ # Receive and process a CONTINUATION frame.
334
+ # @parameter frame [ContinuationFrame] The continuation frame.
335
+ # @raises [ProtocolError] Always raises as unexpected continuation frames are not supported.
336
+ #
337
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:662
338
+ def receive_continuation(frame); end
339
+
340
+ # Process a DATA frame from the remote peer.
341
+ # @parameter frame [DataFrame] The data frame to process.
342
+ # @raises [ProtocolError] If data is received for invalid stream.
343
+ #
344
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:431
345
+ def receive_data(frame); end
346
+
347
+ # Receive and process a generic frame (default handler).
348
+ # @parameter frame [Frame] The frame to receive.
349
+ #
350
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:668
351
+ def receive_frame(frame); end
352
+
353
+ # Process a GOAWAY frame from the remote peer.
354
+ #
355
+ # A GOAWAY frame with a zero error code is a graceful shutdown: the remote peer will not accept any new streams, but it is still processing the streams at or below `last_stream_id` and will send their responses (RFC 9113 §6.8). We must keep reading until those streams complete, otherwise requests which the remote peer has already processed - and whose side effects have already happened - fail locally. The connection is closed once the last of those streams completes, or the remote peer closes it.
356
+ #
357
+ # A GOAWAY frame with a non-zero error code is a connection error: the connection transitions into the closed state and {GoawayError} is raised.
358
+ #
359
+ # @parameter frame [GoawayFrame] The GOAWAY frame to process.
360
+ # @raises [GoawayError] If the frame indicates a connection error.
361
+ #
362
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:269
363
+ def receive_goaway(frame); end
364
+
365
+ # On the server side, starts a new request.
366
+ #
367
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:505
368
+ def receive_headers(frame); end
369
+
370
+ # Process a PING frame from the remote peer.
371
+ # @parameter frame [PingFrame] The ping frame to process.
372
+ # @raises [ProtocolError] If ping is received in invalid state.
373
+ #
374
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:411
375
+ def receive_ping(frame); end
376
+
377
+ # Receive and process a PRIORITY_UPDATE frame.
378
+ # @parameter frame [PriorityUpdateFrame] The priority update frame.
379
+ # @raises [ProtocolError] If the stream ID is invalid.
380
+ #
381
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:550
382
+ def receive_priority_update(frame); end
383
+
384
+ # Receive and process a PUSH_PROMISE frame.
385
+ # @parameter frame [PushPromiseFrame] The push promise frame.
386
+ # @raises [ProtocolError] Always raises as push promises are not supported.
387
+ #
388
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:543
389
+ def receive_push_promise(frame); end
390
+
391
+ # Receive and process a RST_STREAM frame.
392
+ # @parameter frame [ResetStreamFrame] The reset stream frame.
393
+ # @raises [ProtocolError] If the frame is invalid for connection context.
394
+ #
395
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:613
396
+ def receive_reset_stream(frame); end
397
+
398
+ # Receive and process a SETTINGS frame from the remote peer.
399
+ # @parameter frame [SettingsFrame] The settings frame to process.
400
+ # @raises [ProtocolError] If the connection is in an invalid state.
401
+ #
402
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:384
403
+ def receive_settings(frame); end
404
+
405
+ # Receive and process a WINDOW_UPDATE frame.
406
+ # @parameter frame [WindowUpdateFrame] The window update frame.
407
+ #
408
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:640
409
+ def receive_window_update(frame); end
410
+
411
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:90
412
+ def remote_settings; end
413
+
414
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:90
415
+ def remote_settings=(_arg0); end
416
+
417
+ # The highest stream_id that has been successfully accepted by this connection.
418
+ #
419
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:100
420
+ def remote_stream_id; end
421
+
422
+ # Our window for sending data. When we send data, it reduces this window.
423
+ #
424
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:97
425
+ def remote_window; end
426
+
427
+ # Tell the remote end that the connection is being shut down. If the `error_code` is 0, this is a graceful shutdown. The other end of the connection should not make any new streams, but existing streams may be completed.
428
+ #
429
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:252
430
+ def send_goaway(error_code = T.unsafe(nil), message = T.unsafe(nil)); end
431
+
432
+ # Send a PING frame to the remote peer.
433
+ # @parameter data [String] The 8-byte ping payload data.
434
+ #
435
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:397
436
+ def send_ping(data); end
437
+
438
+ # Send updated settings to the remote peer.
439
+ # @parameter changes [Hash] The settings changes to send.
440
+ #
441
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:235
442
+ def send_settings(changes); end
443
+
444
+ # Check if the given stream ID represents a server-initiated stream.
445
+ # Server streams always have even numbered IDs.
446
+ # @parameter id [Integer] The stream ID to check.
447
+ # @returns [Boolean] True if the stream ID is server-initiated.
448
+ #
449
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:575
450
+ def server_stream_id?(id); end
451
+
452
+ # Connection state (:new, :open, :closed).
453
+ #
454
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:86
455
+ def state; end
456
+
457
+ # Connection state (:new, :open, :closed).
458
+ #
459
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:86
460
+ def state=(_arg0); end
461
+
462
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:182
463
+ def streams; end
464
+
465
+ # Execute a block within a synchronized context.
466
+ # This method provides a synchronization primitive for thread safety.
467
+ # @yields The block to execute within the synchronized context.
468
+ #
469
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:203
470
+ def synchronize; end
471
+
472
+ # Update local settings and adjust stream window capacities.
473
+ # @parameter changes [Hash] The settings changes to apply locally.
474
+ #
475
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:327
476
+ def update_local_settings(changes); end
477
+
478
+ # Update remote settings and adjust stream window capacities.
479
+ # @parameter changes [Hash] The settings changes to apply to remote peer.
480
+ #
481
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:339
482
+ def update_remote_settings(changes); end
483
+
484
+ # Check if the given stream ID is valid for remote initiation.
485
+ # This method should be overridden by client/server implementations.
486
+ # @parameter stream_id [Integer] The stream ID to validate.
487
+ # @returns [Boolean] True if the stream ID is valid for remote initiation.
488
+ #
489
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:447
490
+ def valid_remote_stream_id?(stream_id); end
491
+
492
+ # Write a single frame to the connection.
493
+ # @parameter frame [Frame] The frame to write.
494
+ #
495
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:301
496
+ def write_frame(frame); end
497
+
498
+ # Write multiple frames within a synchronized block.
499
+ # @yields {|framer| ...} The framer for writing multiple frames.
500
+ # @parameter framer [Framer] The framer instance.
501
+ # @raises [EOFError] If the connection is closed.
502
+ #
503
+ # pkg:gem/protocol-http2#lib/protocol/http2/connection.rb:313
504
+ def write_frames; end
505
+ end
506
+
507
+ # The CONTINUATION frame is used to continue a sequence of header block fragments. Any number of CONTINUATION frames can be sent, as long as the preceding frame is on the same stream and is a HEADERS, PUSH_PROMISE, or CONTINUATION frame without the END_HEADERS flag set.
508
+ #
509
+ # +---------------------------------------------------------------+
510
+ # +---------------------------------------------------------------+
511
+ #
512
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:122
513
+ class Protocol::HTTP2::ContinuationFrame < ::Protocol::HTTP2::Frame
514
+ include ::Protocol::HTTP2::Continued
515
+
516
+ # This is only invoked if the continuation is received out of the normal flow.
517
+ #
518
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:136
519
+ def apply(connection); end
520
+
521
+ # Get a string representation of the continuation frame.
522
+ # @returns [String] Human-readable frame information.
523
+ #
524
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:142
525
+ def inspect; end
526
+
527
+ # Read the frame and any continuation frames from the stream.
528
+ # @parameter stream [IO] The stream to read from.
529
+ # @parameter maximum_frame_size [Integer] Maximum allowed frame size.
530
+ # @parameter limit [Integer] The maximum number of continuation frames to read.
531
+ #
532
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:131
533
+ def read(stream, maximum_frame_size, limit = T.unsafe(nil)); end
534
+ end
535
+
536
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:125
537
+ Protocol::HTTP2::ContinuationFrame::TYPE = T.let(T.unsafe(nil), Integer)
538
+
539
+ # Module for frames that can be continued with CONTINUATION frames.
540
+ #
541
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:12
542
+ module Protocol::HTTP2::Continued
543
+ # Initialize a continuable frame.
544
+ # @parameter arguments [Array] Arguments passed to parent constructor.
545
+ #
546
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:18
547
+ def initialize(*); end
548
+
549
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:79
550
+ def continuation; end
551
+
552
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:79
553
+ def continuation=(_arg0); end
554
+
555
+ # Check if this frame has continuation frames.
556
+ # @returns [Boolean] True if there are continuation frames.
557
+ #
558
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:26
559
+ def continued?; end
560
+
561
+ # Check if this is the last header block fragment.
562
+ # @returns [Boolean] True if the END_HEADERS flag is set.
563
+ #
564
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:32
565
+ def end_headers?; end
566
+
567
+ # Pack data into this frame, creating continuation frames if needed.
568
+ # @parameter data [String] The data to pack.
569
+ # @parameter options [Hash] Options including maximum_size.
570
+ #
571
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:84
572
+ def pack(data, **options); end
573
+
574
+ # Read the frame and any continuation frames from the stream.
575
+ #
576
+ # There is an upper limit to the number of continuation frames that can be read to prevent resource exhaustion. If the limit is 0, only one frame will be read (the initial frame). Otherwise, the limit decrements with each continuation frame read.
577
+ #
578
+ # @parameter stream [IO] The stream to read from.
579
+ # @parameter maximum_frame_size [Integer] Maximum allowed frame size.
580
+ # @parameter limit [Integer] The maximum number of continuation frames to read.
581
+ #
582
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:43
583
+ def read(stream, maximum_frame_size, limit = T.unsafe(nil)); end
584
+
585
+ # Unpack data from this frame and any continuation frames.
586
+ # @returns [String] The complete unpacked data.
587
+ #
588
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:107
589
+ def unpack; end
590
+
591
+ # Write the frame and any continuation frames to the stream.
592
+ # @parameter stream [IO] The stream to write to.
593
+ #
594
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:71
595
+ def write(stream); end
596
+ end
597
+
598
+ # @constant [Integer] The maximum number of continuation frames to read to prevent resource exhaustion.
599
+ #
600
+ # pkg:gem/protocol-http2#lib/protocol/http2/continuation_frame.rb:14
601
+ Protocol::HTTP2::Continued::LIMIT = T.let(T.unsafe(nil), Integer)
602
+
603
+ # DATA frames convey arbitrary, variable-length sequences of octets associated with a stream. One or more DATA frames are used, for instance, to carry HTTP request or response payloads.
604
+ #
605
+ # DATA frames MAY also contain padding. Padding can be added to DATA frames to obscure the size of messages.
606
+ #
607
+ # +---------------+
608
+ # |Pad Length? (8)|
609
+ # +---------------+-----------------------------------------------+
610
+ # +---------------------------------------------------------------+
611
+ # +---------------------------------------------------------------+
612
+ #
613
+ # pkg:gem/protocol-http2#lib/protocol/http2/data_frame.rb:23
614
+ class Protocol::HTTP2::DataFrame < ::Protocol::HTTP2::Frame
615
+ include ::Protocol::HTTP2::Padded
616
+
617
+ # Apply this DATA frame to a connection for processing.
618
+ # @parameter connection [Connection] The connection to apply the frame to.
619
+ #
620
+ # pkg:gem/protocol-http2#lib/protocol/http2/data_frame.rb:49
621
+ def apply(connection); end
622
+
623
+ # Check if this frame marks the end of the stream.
624
+ # @returns [Boolean] True if the END_STREAM flag is set.
625
+ #
626
+ # pkg:gem/protocol-http2#lib/protocol/http2/data_frame.rb:30
627
+ def end_stream?; end
628
+
629
+ # Provide a readable representation of the frame for debugging.
630
+ # @returns [String] A formatted string representation of the frame.
631
+ #
632
+ # pkg:gem/protocol-http2#lib/protocol/http2/data_frame.rb:55
633
+ def inspect; end
634
+
635
+ # Pack data into the frame, handling empty data as stream end.
636
+ # @parameter data [String | Nil] The data to pack into the frame.
637
+ # @parameter arguments [Array] Additional arguments passed to super.
638
+ # @parameter options [Hash] Additional options passed to super.
639
+ #
640
+ # pkg:gem/protocol-http2#lib/protocol/http2/data_frame.rb:38
641
+ def pack(data, *arguments, **options); end
642
+ end
643
+
644
+ # pkg:gem/protocol-http2#lib/protocol/http2/data_frame.rb:26
645
+ Protocol::HTTP2::DataFrame::TYPE = T.let(T.unsafe(nil), Integer)
646
+
647
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:12
648
+ Protocol::HTTP2::END_HEADERS = T.let(T.unsafe(nil), Integer)
649
+
650
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:11
651
+ Protocol::HTTP2::END_STREAM = T.let(T.unsafe(nil), Integer)
652
+
653
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:21
654
+ Protocol::HTTP2::ENHANCE_YOUR_CALM = T.let(T.unsafe(nil), Integer)
655
+
656
+ # Status codes as defined by <https://tools.ietf.org/html/rfc7540#section-7>.
657
+ #
658
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:11
659
+ class Protocol::HTTP2::Error < ::Protocol::HTTP::Error
660
+ class << self
661
+ # Get the message for a given HTTP/2 error code.
662
+ # @parameter code [Integer] The HTTP/2 error code.
663
+ # @returns [String] The error message.
664
+ #
665
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:74
666
+ def message_for(code); end
667
+ end
668
+ end
669
+
670
+ # Used by the endpoint to indicate that the stream is no longer needed.
671
+ #
672
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:37
673
+ Protocol::HTTP2::Error::CANCEL = T.let(T.unsafe(nil), Integer)
674
+
675
+ # The endpoint is unable to maintain the header compression context for the connection.
676
+ #
677
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:40
678
+ Protocol::HTTP2::Error::COMPRESSION_ERROR = T.let(T.unsafe(nil), Integer)
679
+
680
+ # The connection established in response to a CONNECT request was reset or abnormally closed.
681
+ #
682
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:43
683
+ Protocol::HTTP2::Error::CONNECT_ERROR = T.let(T.unsafe(nil), Integer)
684
+
685
+ # The endpoint detected that its peer is exhibiting a behavior that might be generating excessive load.
686
+ #
687
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:46
688
+ Protocol::HTTP2::Error::ENHANCE_YOUR_CALM = T.let(T.unsafe(nil), Integer)
689
+
690
+ # The endpoint detected that its peer violated the flow-control protocol.
691
+ #
692
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:22
693
+ Protocol::HTTP2::Error::FLOW_CONTROL_ERROR = T.let(T.unsafe(nil), Integer)
694
+
695
+ # The endpoint received a frame with an invalid size.
696
+ #
697
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:31
698
+ Protocol::HTTP2::Error::FRAME_SIZE_ERROR = T.let(T.unsafe(nil), Integer)
699
+
700
+ # The endpoint requires that HTTP/1.1 be used instead of HTTP/2.
701
+ #
702
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:52
703
+ Protocol::HTTP2::Error::HTTP_1_1_REQUIRED = T.let(T.unsafe(nil), Integer)
704
+
705
+ # The underlying transport has properties that do not meet minimum security requirements.
706
+ #
707
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:49
708
+ Protocol::HTTP2::Error::INADEQUATE_SECURITY = T.let(T.unsafe(nil), Integer)
709
+
710
+ # The endpoint encountered an unexpected internal error.
711
+ #
712
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:19
713
+ Protocol::HTTP2::Error::INTERNAL_ERROR = T.let(T.unsafe(nil), Integer)
714
+
715
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:54
716
+ Protocol::HTTP2::Error::MESSAGES = T.let(T.unsafe(nil), Hash)
717
+
718
+ # The associated condition is not a result of an error. For example, a GOAWAY might include this code to indicate graceful shutdown of a connection.
719
+ #
720
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:13
721
+ Protocol::HTTP2::Error::NO_ERROR = T.let(T.unsafe(nil), Integer)
722
+
723
+ # The endpoint detected an unspecific protocol error. This error is for use when a more specific error code is not available.
724
+ #
725
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:16
726
+ Protocol::HTTP2::Error::PROTOCOL_ERROR = T.let(T.unsafe(nil), Integer)
727
+
728
+ # The endpoint refused the stream prior to performing any application processing.
729
+ #
730
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:34
731
+ Protocol::HTTP2::Error::REFUSED_STREAM = T.let(T.unsafe(nil), Integer)
732
+
733
+ # The endpoint sent a SETTINGS frame but did not receive a response in a timely manner.
734
+ #
735
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:25
736
+ Protocol::HTTP2::Error::SETTINGS_TIMEOUT = T.let(T.unsafe(nil), Integer)
737
+
738
+ # The endpoint received a frame after a stream was half-closed.
739
+ #
740
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:28
741
+ Protocol::HTTP2::Error::STREAM_CLOSED = T.let(T.unsafe(nil), Integer)
742
+
743
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:13
744
+ Protocol::HTTP2::FLOW_CONTROL_ERROR = T.let(T.unsafe(nil), Integer)
745
+
746
+ # HTTP/2 frame type mapping as defined by the spec
747
+ #
748
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:22
749
+ Protocol::HTTP2::FRAMES = T.let(T.unsafe(nil), Array)
750
+
751
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:16
752
+ Protocol::HTTP2::FRAME_SIZE_ERROR = T.let(T.unsafe(nil), Integer)
753
+
754
+ # Raised on invalid flow control frame or command.
755
+ #
756
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:147
757
+ class Protocol::HTTP2::FlowControlError < ::Protocol::HTTP2::ProtocolError
758
+ # Initialize a flow control error.
759
+ # @parameter message [String] The error message.
760
+ #
761
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:150
762
+ def initialize(message); end
763
+ end
764
+
765
+ # Provides flow control functionality for HTTP/2 connections and streams.
766
+ # This module implements window-based flow control as defined in RFC 7540.
767
+ #
768
+ # pkg:gem/protocol-http2#lib/protocol/http2/flow_controlled.rb:13
769
+ module Protocol::HTTP2::FlowControlled
770
+ # This could be negative if the window has been overused due to a change in initial window size.
771
+ #
772
+ # pkg:gem/protocol-http2#lib/protocol/http2/flow_controlled.rb:21
773
+ def available_frame_size(maximum_frame_size = T.unsafe(nil)); end
774
+
775
+ # Get the available window size for sending data.
776
+ # @returns [Integer] The number of bytes that can be sent.
777
+ #
778
+ # pkg:gem/protocol-http2#lib/protocol/http2/flow_controlled.rb:16
779
+ def available_size; end
780
+
781
+ # Consume local window space for a received frame.
782
+ # @parameter frame [Frame] The frame that consumed window space.
783
+ #
784
+ # pkg:gem/protocol-http2#lib/protocol/http2/flow_controlled.rb:56
785
+ def consume_local_window(frame); end
786
+
787
+ # Keep track of the amount of data sent, and fail if is too much.
788
+ #
789
+ # pkg:gem/protocol-http2#lib/protocol/http2/flow_controlled.rb:34
790
+ def consume_remote_window(frame); end
791
+
792
+ # Process a received WINDOW_UPDATE frame.
793
+ # @parameter frame [WindowUpdateFrame] The window update frame to process.
794
+ # @raises [ProtocolError] If the window increment is invalid.
795
+ #
796
+ # pkg:gem/protocol-http2#lib/protocol/http2/flow_controlled.rb:82
797
+ def receive_window_update(frame); end
798
+
799
+ # Request a window update if the local window is limited.
800
+ #
801
+ # pkg:gem/protocol-http2#lib/protocol/http2/flow_controlled.rb:63
802
+ def request_window_update; end
803
+
804
+ # Notify the remote end that we are prepared to receive more data:
805
+ #
806
+ # pkg:gem/protocol-http2#lib/protocol/http2/flow_controlled.rb:70
807
+ def send_window_update(window_increment); end
808
+
809
+ # Update the local window after receiving data.
810
+ # @parameter frame [Frame] The frame that was received.
811
+ #
812
+ # pkg:gem/protocol-http2#lib/protocol/http2/flow_controlled.rb:49
813
+ def update_local_window(frame); end
814
+
815
+ # The window has been expanded by the given amount.
816
+ # @parameter size [Integer] the maximum amount of data to send.
817
+ # @return [Boolean] whether the window update was used or not.
818
+ #
819
+ # pkg:gem/protocol-http2#lib/protocol/http2/flow_controlled.rb:95
820
+ def window_updated(size); end
821
+ end
822
+
823
+ # Represents the base class for all HTTP/2 frames.
824
+ # This class provides common functionality for frame parsing, serialization,
825
+ # and manipulation according to RFC 7540.
826
+ #
827
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:23
828
+ class Protocol::HTTP2::Frame
829
+ include ::Comparable
830
+
831
+ # @parameter length [Integer] the length of the payload, or nil if the header has not been read yet.
832
+ #
833
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:41
834
+ def initialize(stream_id = T.unsafe(nil), flags = T.unsafe(nil), type = T.unsafe(nil), length = T.unsafe(nil), payload = T.unsafe(nil)); end
835
+
836
+ # Compare frames based on their essential properties.
837
+ # @parameter other [Frame] The frame to compare with.
838
+ # @returns [Integer] -1, 0, or 1 for comparison result.
839
+ #
840
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:58
841
+ def <=>(other); end
842
+
843
+ # Apply the frame to a connection for processing.
844
+ # @parameter connection [Connection] The connection to apply the frame to.
845
+ #
846
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:242
847
+ def apply(connection); end
848
+
849
+ # Clear specific flags on the frame.
850
+ # @parameter mask [Integer] The flag bits to clear.
851
+ #
852
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:113
853
+ def clear_flags(mask); end
854
+
855
+ # Check if frame is a connection frame: SETTINGS, PING, GOAWAY, and any
856
+ # frame addressed to stream ID = 0.
857
+ #
858
+ # @return [Boolean] If this is a connection frame.
859
+ #
860
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:128
861
+ def connection?; end
862
+
863
+ # Check if specific flags are set on the frame.
864
+ # @parameter mask [Integer] The flag bits to check.
865
+ # @returns [Boolean] True if any of the flags are set.
866
+ #
867
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:120
868
+ def flag_set?(mask); end
869
+
870
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:82
871
+ def flags; end
872
+
873
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:82
874
+ def flags=(_arg0); end
875
+
876
+ # Generates common 9-byte frame header.
877
+ # - http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-4.1
878
+ #
879
+ # @return [String]
880
+ #
881
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:139
882
+ def header; end
883
+
884
+ # Provide a readable representation of the frame for debugging.
885
+ # @returns [String] A formatted string representation of the frame.
886
+ #
887
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:248
888
+ def inspect; end
889
+
890
+ # The generic frame header uses the following binary representation:
891
+ #
892
+ # +-----------------------------------------------+
893
+ # +---------------+---------------+---------------+
894
+ # +-+-------------+---------------+-------------------------------+
895
+ # |R| Stream Identifier (31) |
896
+ # +=+=============================================================+
897
+ # +---------------------------------------------------------------+
898
+ #
899
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:80
900
+ def length; end
901
+
902
+ # The generic frame header uses the following binary representation:
903
+ #
904
+ # +-----------------------------------------------+
905
+ # +---------------+---------------+---------------+
906
+ # +-+-------------+---------------+-------------------------------+
907
+ # |R| Stream Identifier (31) |
908
+ # +=+=============================================================+
909
+ # +---------------------------------------------------------------+
910
+ #
911
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:80
912
+ def length=(_arg0); end
913
+
914
+ # Pack payload data into the frame.
915
+ # @parameter payload [String] The payload data to pack.
916
+ # @parameter maximum_size [Integer | Nil] Optional maximum payload size.
917
+ # @raises [ProtocolError] If payload exceeds maximum size.
918
+ #
919
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:96
920
+ def pack(payload, maximum_size: T.unsafe(nil)); end
921
+
922
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:84
923
+ def payload; end
924
+
925
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:84
926
+ def payload=(_arg0); end
927
+
928
+ # Read the complete frame (header and payload) from a stream.
929
+ # @parameter stream [IO] The stream to read from.
930
+ # @parameter maximum_frame_size [Integer] The maximum allowed frame size.
931
+ # @raises [FrameSizeError] If the frame exceeds the maximum size.
932
+ # @returns [Frame] Self for method chaining.
933
+ #
934
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:199
935
+ def read(stream, maximum_frame_size = T.unsafe(nil)); end
936
+
937
+ # Read the frame header from a stream.
938
+ # @parameter stream [IO] The stream to read from.
939
+ # @raises [EOFError] If the header cannot be read completely.
940
+ #
941
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:174
942
+ def read_header(stream); end
943
+
944
+ # Read the frame payload from a stream.
945
+ # @parameter stream [IO] The stream to read from.
946
+ # @raises [EOFError] If the payload cannot be read completely.
947
+ #
948
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:186
949
+ def read_payload(stream); end
950
+
951
+ # Set specific flags on the frame.
952
+ # @parameter mask [Integer] The flag bits to set.
953
+ #
954
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:107
955
+ def set_flags(mask); end
956
+
957
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:83
958
+ def stream_id; end
959
+
960
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:83
961
+ def stream_id=(_arg0); end
962
+
963
+ # Convert frame to array representation for comparison.
964
+ # @returns [Array] Frame properties as an array.
965
+ #
966
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:64
967
+ def to_ary; end
968
+
969
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:81
970
+ def type; end
971
+
972
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:81
973
+ def type=(_arg0); end
974
+
975
+ # Unpack the frame payload data.
976
+ # @returns [String] The frame payload.
977
+ #
978
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:88
979
+ def unpack; end
980
+
981
+ # Check if the frame has a valid type identifier.
982
+ # @returns [Boolean] True if the frame type is valid.
983
+ #
984
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:51
985
+ def valid_type?; end
986
+
987
+ # Write the complete frame (header and payload) to a stream.
988
+ # @parameter stream [IO] The stream to write to.
989
+ # @raises [ProtocolError] If frame validation fails.
990
+ #
991
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:224
992
+ def write(stream); end
993
+
994
+ # Write the frame header to a stream.
995
+ # @parameter stream [IO] The stream to write to.
996
+ #
997
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:211
998
+ def write_header(stream); end
999
+
1000
+ # Write the frame payload to a stream.
1001
+ # @parameter stream [IO] The stream to write to.
1002
+ #
1003
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:217
1004
+ def write_payload(stream); end
1005
+
1006
+ class << self
1007
+ # Decodes common 9-byte header.
1008
+ #
1009
+ # @parameter buffer [String]
1010
+ #
1011
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:161
1012
+ def parse_header(buffer); end
1013
+ end
1014
+ end
1015
+
1016
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:132
1017
+ Protocol::HTTP2::Frame::HEADER_FORMAT = T.let(T.unsafe(nil), String)
1018
+
1019
+ # Used for generating 24-bit frame length:
1020
+ #
1021
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:34
1022
+ Protocol::HTTP2::Frame::LENGTH_HISHIFT = T.let(T.unsafe(nil), Integer)
1023
+
1024
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:35
1025
+ Protocol::HTTP2::Frame::LENGTH_LOMASK = T.let(T.unsafe(nil), Integer)
1026
+
1027
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:133
1028
+ Protocol::HTTP2::Frame::STREAM_ID_MASK = T.let(T.unsafe(nil), Integer)
1029
+
1030
+ # The base class does not have any specific type index:
1031
+ #
1032
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:38
1033
+ Protocol::HTTP2::Frame::TYPE = T.let(T.unsafe(nil), T.untyped)
1034
+
1035
+ # The absolute maximum bounds for the length field:
1036
+ #
1037
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:31
1038
+ Protocol::HTTP2::Frame::VALID_LENGTH = T.let(T.unsafe(nil), Range)
1039
+
1040
+ # Stream Identifier cannot be bigger than this:
1041
+ # https://http2.github.stream/http2-spec/#rfc.section.4.1
1042
+ #
1043
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:28
1044
+ Protocol::HTTP2::Frame::VALID_STREAM_ID = T.let(T.unsafe(nil), Range)
1045
+
1046
+ # When the frame payload does not match expectations.
1047
+ #
1048
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:129
1049
+ class Protocol::HTTP2::FrameSizeError < ::Protocol::HTTP2::ProtocolError
1050
+ # Initialize a frame size error.
1051
+ # @parameter message [String] The error message.
1052
+ #
1053
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:132
1054
+ def initialize(message); end
1055
+ end
1056
+
1057
+ # Handles frame serialization and deserialization for HTTP/2 connections.
1058
+ # This class manages the reading and writing of HTTP/2 frames to/from a stream.
1059
+ #
1060
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:47
1061
+ class Protocol::HTTP2::Framer
1062
+ # Initialize a new framer with a stream and frame definitions.
1063
+ # @parameter stream [IO] The underlying stream for frame I/O.
1064
+ # @parameter frames [Array] Frame type definitions to use.
1065
+ #
1066
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:51
1067
+ def initialize(stream, frames = T.unsafe(nil)); end
1068
+
1069
+ # Close the underlying stream.
1070
+ #
1071
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:62
1072
+ def close; end
1073
+
1074
+ # Check if the underlying stream is closed.
1075
+ # @returns [Boolean] True if the stream is closed.
1076
+ #
1077
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:68
1078
+ def closed?; end
1079
+
1080
+ # Flush the underlying stream.
1081
+ #
1082
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:57
1083
+ def flush; end
1084
+
1085
+ # Read and validate the HTTP/2 connection preface from the stream.
1086
+ # @raises [HandshakeError] If the preface is invalid.
1087
+ #
1088
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:79
1089
+ def read_connection_preface; end
1090
+
1091
+ # @return [Frame] the frame that has been read from the underlying IO.
1092
+ # @raise if the underlying IO fails for some reason.
1093
+ #
1094
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:91
1095
+ def read_frame(maximum_frame_size = T.unsafe(nil)); end
1096
+
1097
+ # Read a frame header from the stream.
1098
+ # @returns [Array] Parsed frame header components: length, type, flags, stream_id.
1099
+ # @raises [EOFError] If the header cannot be read completely.
1100
+ #
1101
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:123
1102
+ def read_header; end
1103
+
1104
+ # Write the HTTP/2 connection preface to the stream.
1105
+ #
1106
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:73
1107
+ def write_connection_preface; end
1108
+
1109
+ # Write a frame to the underlying IO.
1110
+ # After writing one or more frames, you should call flush to ensure the frames are sent to the remote peer.
1111
+ # @parameter frame [Frame] the frame to write.
1112
+ #
1113
+ # pkg:gem/protocol-http2#lib/protocol/http2/framer.rb:112
1114
+ def write_frame(frame); end
1115
+ end
1116
+
1117
+ # Represents a GOAWAY-related protocol error.
1118
+ #
1119
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:125
1120
+ class Protocol::HTTP2::GoawayError < ::Protocol::HTTP2::ProtocolError; end
1121
+
1122
+ # The GOAWAY frame is used to initiate shutdown of a connection or to signal serious error conditions. GOAWAY allows an endpoint to gracefully stop accepting new streams while still finishing processing of previously established streams. This enables administrative actions, like server maintenance.
1123
+ #
1124
+ # +-+-------------------------------------------------------------+
1125
+ # |R| Last-Stream-ID (31) |
1126
+ # +-+-------------------------------------------------------------+
1127
+ # +---------------------------------------------------------------+
1128
+ # +---------------------------------------------------------------+
1129
+ #
1130
+ # pkg:gem/protocol-http2#lib/protocol/http2/goaway_frame.rb:20
1131
+ class Protocol::HTTP2::GoawayFrame < ::Protocol::HTTP2::Frame
1132
+ # Apply this GOAWAY frame to a connection for processing.
1133
+ # @parameter connection [Connection] The connection to apply the frame to.
1134
+ #
1135
+ # pkg:gem/protocol-http2#lib/protocol/http2/goaway_frame.rb:51
1136
+ def apply(connection); end
1137
+
1138
+ # Check if this frame applies to the connection level.
1139
+ # @returns [Boolean] Always returns true for GOAWAY frames.
1140
+ #
1141
+ # pkg:gem/protocol-http2#lib/protocol/http2/goaway_frame.rb:26
1142
+ def connection?; end
1143
+
1144
+ # Pack GOAWAY frame data into payload.
1145
+ # @parameter last_stream_id [Integer] The last processed stream ID.
1146
+ # @parameter error_code [Integer] The error code for connection termination.
1147
+ # @parameter data [String] Additional debug data.
1148
+ #
1149
+ # pkg:gem/protocol-http2#lib/protocol/http2/goaway_frame.rb:45
1150
+ def pack(last_stream_id, error_code, data); end
1151
+
1152
+ # Unpack the GOAWAY frame payload.
1153
+ # @returns [Array] Last stream ID, error code, and debug data.
1154
+ #
1155
+ # pkg:gem/protocol-http2#lib/protocol/http2/goaway_frame.rb:32
1156
+ def unpack; end
1157
+ end
1158
+
1159
+ # pkg:gem/protocol-http2#lib/protocol/http2/goaway_frame.rb:22
1160
+ Protocol::HTTP2::GoawayFrame::FORMAT = T.let(T.unsafe(nil), String)
1161
+
1162
+ # pkg:gem/protocol-http2#lib/protocol/http2/goaway_frame.rb:21
1163
+ Protocol::HTTP2::GoawayFrame::TYPE = T.let(T.unsafe(nil), Integer)
1164
+
1165
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:23
1166
+ Protocol::HTTP2::HTTP_1_1_REQUIRED = T.let(T.unsafe(nil), Integer)
1167
+
1168
+ # Raised if connection header is missing or invalid indicating that
1169
+ # this is an invalid HTTP 2.0 request - no frames are emitted and the
1170
+ # connection must be aborted.
1171
+ #
1172
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:85
1173
+ class Protocol::HTTP2::HandshakeError < ::Protocol::HTTP2::Error; end
1174
+
1175
+ # Represents a header processing error.
1176
+ #
1177
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:138
1178
+ class Protocol::HTTP2::HeaderError < ::Protocol::HTTP2::StreamClosed
1179
+ # Initialize a header error.
1180
+ # @parameter message [String] The error message.
1181
+ #
1182
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:141
1183
+ def initialize(message); end
1184
+ end
1185
+
1186
+ # The HEADERS frame is used to open a stream, and additionally carries a header block fragment. HEADERS frames can be sent on a stream in the "idle", "reserved (local)", "open", or "half-closed (remote)" state.
1187
+ #
1188
+ # +---------------+
1189
+ # |Pad Length? (8)|
1190
+ # +-+-------------+-----------------------------------------------+
1191
+ # |E| Stream Dependency? (31) |
1192
+ # +-+-------------+-----------------------------------------------+
1193
+ # +-+-------------+-----------------------------------------------+
1194
+ # +---------------------------------------------------------------+
1195
+ # +---------------------------------------------------------------+
1196
+ #
1197
+ # pkg:gem/protocol-http2#lib/protocol/http2/headers_frame.rb:26
1198
+ class Protocol::HTTP2::HeadersFrame < ::Protocol::HTTP2::Frame
1199
+ include ::Protocol::HTTP2::Padded
1200
+ include ::Protocol::HTTP2::Continued
1201
+
1202
+ # Apply this HEADERS frame to a connection for processing.
1203
+ # @parameter connection [Connection] The connection to apply the frame to.
1204
+ #
1205
+ # pkg:gem/protocol-http2#lib/protocol/http2/headers_frame.rb:70
1206
+ def apply(connection); end
1207
+
1208
+ # Check if this frame ends the stream.
1209
+ # @returns [Boolean] True if the END_STREAM flag is set.
1210
+ #
1211
+ # pkg:gem/protocol-http2#lib/protocol/http2/headers_frame.rb:39
1212
+ def end_stream?; end
1213
+
1214
+ # Get a string representation of the headers frame.
1215
+ # @returns [String] Human-readable frame information.
1216
+ #
1217
+ # pkg:gem/protocol-http2#lib/protocol/http2/headers_frame.rb:76
1218
+ def inspect; end
1219
+
1220
+ # Pack header block data into the frame.
1221
+ # @parameter data [String] The header block data to pack.
1222
+ # @parameter arguments [Array] Additional arguments.
1223
+ # @parameter options [Hash] Options for packing.
1224
+ #
1225
+ # pkg:gem/protocol-http2#lib/protocol/http2/headers_frame.rb:60
1226
+ def pack(data, *arguments, **options); end
1227
+
1228
+ # Check if this frame contains priority information.
1229
+ # @returns [Boolean] True if the PRIORITY flag is set.
1230
+ #
1231
+ # pkg:gem/protocol-http2#lib/protocol/http2/headers_frame.rb:33
1232
+ def priority?; end
1233
+
1234
+ # Unpack the header block fragment from the frame.
1235
+ # @returns [String] The unpacked header block data.
1236
+ #
1237
+ # pkg:gem/protocol-http2#lib/protocol/http2/headers_frame.rb:45
1238
+ def unpack; end
1239
+ end
1240
+
1241
+ # pkg:gem/protocol-http2#lib/protocol/http2/headers_frame.rb:29
1242
+ Protocol::HTTP2::HeadersFrame::TYPE = T.let(T.unsafe(nil), Integer)
1243
+
1244
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:22
1245
+ Protocol::HTTP2::INADEQUATE_SECURITY = T.let(T.unsafe(nil), Integer)
1246
+
1247
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:12
1248
+ Protocol::HTTP2::INTERNAL_ERROR = T.let(T.unsafe(nil), Integer)
1249
+
1250
+ # This is a window which efficiently maintains a desired capacity.
1251
+ #
1252
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:97
1253
+ class Protocol::HTTP2::LocalWindow < ::Protocol::HTTP2::Window
1254
+ # Initialize a local window with optional desired capacity.
1255
+ # @parameter capacity [Integer] The initial window capacity.
1256
+ # @parameter desired [Integer] The desired window capacity.
1257
+ #
1258
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:101
1259
+ def initialize(capacity = T.unsafe(nil), desired: T.unsafe(nil)); end
1260
+
1261
+ # The desired capacity of the window.
1262
+ #
1263
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:110
1264
+ def desired; end
1265
+
1266
+ # The desired capacity of the window.
1267
+ #
1268
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:110
1269
+ def desired=(_arg0); end
1270
+
1271
+ # Get a string representation of the local window.
1272
+ # @returns [String] Human-readable local window information.
1273
+ #
1274
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:136
1275
+ def inspect; end
1276
+
1277
+ # Check if the window is limited, considering desired capacity.
1278
+ # @returns [Boolean] True if window needs updating based on desired capacity.
1279
+ #
1280
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:125
1281
+ def limited?; end
1282
+
1283
+ # Get the amount of window that should be reclaimed, considering desired capacity.
1284
+ # @returns [Integer] The amount needed to reach desired capacity or used space.
1285
+ #
1286
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:114
1287
+ def wanted; end
1288
+ end
1289
+
1290
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:18
1291
+ Protocol::HTTP2::MAXIMUM_ALLOWED_FRAME_SIZE = T.let(T.unsafe(nil), Integer)
1292
+
1293
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:16
1294
+ Protocol::HTTP2::MAXIMUM_ALLOWED_WINDOW_SIZE = T.let(T.unsafe(nil), Integer)
1295
+
1296
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:17
1297
+ Protocol::HTTP2::MINIMUM_ALLOWED_FRAME_SIZE = T.let(T.unsafe(nil), Integer)
1298
+
1299
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:10
1300
+ Protocol::HTTP2::NO_ERROR = T.let(T.unsafe(nil), Integer)
1301
+
1302
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:13
1303
+ Protocol::HTTP2::PADDED = T.let(T.unsafe(nil), Integer)
1304
+
1305
+ # pkg:gem/protocol-http2#lib/protocol/http2/frame.rb:14
1306
+ Protocol::HTTP2::PRIORITY = T.let(T.unsafe(nil), Integer)
1307
+
1308
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:11
1309
+ Protocol::HTTP2::PROTOCOL_ERROR = T.let(T.unsafe(nil), Integer)
1310
+
1311
+ # Certain frames can have padding:
1312
+ # https://http2.github.io/http2-spec/#padding
1313
+ #
1314
+ # +---------------+
1315
+ # |Pad Length? (8)|
1316
+ # +---------------+-----------------------------------------------+
1317
+ # +---------------------------------------------------------------+
1318
+ # +---------------------------------------------------------------+
1319
+ #
1320
+ # Provides padding functionality for HTTP/2 frames.
1321
+ # Padding can be used to obscure the actual size of frame payloads.
1322
+ #
1323
+ # pkg:gem/protocol-http2#lib/protocol/http2/padded.rb:23
1324
+ module Protocol::HTTP2::Padded
1325
+ # Pack data with optional padding into the frame.
1326
+ # @parameter data [String] The data to pack.
1327
+ # @parameter padding_size [Integer | Nil] Number of padding bytes to add.
1328
+ # @parameter maximum_size [Integer | Nil] Maximum frame size limit.
1329
+ #
1330
+ # pkg:gem/protocol-http2#lib/protocol/http2/padded.rb:34
1331
+ def pack(data, padding_size: T.unsafe(nil), maximum_size: T.unsafe(nil)); end
1332
+
1333
+ # Check if the frame has padding enabled.
1334
+ # @returns [Boolean] True if the PADDED flag is set.
1335
+ #
1336
+ # pkg:gem/protocol-http2#lib/protocol/http2/padded.rb:26
1337
+ def padded?; end
1338
+
1339
+ # Unpack frame data, removing padding if present.
1340
+ # @returns [String] The unpacked data without padding.
1341
+ # @raises [ProtocolError] If padding length is invalid.
1342
+ #
1343
+ # pkg:gem/protocol-http2#lib/protocol/http2/padded.rb:58
1344
+ def unpack; end
1345
+ end
1346
+
1347
+ # Manages pending settings changes that haven't been acknowledged yet.
1348
+ #
1349
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:157
1350
+ class Protocol::HTTP2::PendingSettings
1351
+ # Initialize with current settings.
1352
+ # @parameter current [Settings] The current settings object.
1353
+ #
1354
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:160
1355
+ def initialize(current = T.unsafe(nil)); end
1356
+
1357
+ # Acknowledge the next set of pending changes.
1358
+ #
1359
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:178
1360
+ def acknowledge; end
1361
+
1362
+ # Append changes to the pending queue.
1363
+ # @parameter changes [Hash] Hash of setting changes to queue.
1364
+ #
1365
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:172
1366
+ def append(changes); end
1367
+
1368
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:167
1369
+ def current; end
1370
+
1371
+ # Get the current CONNECT protocol enable setting.
1372
+ # @returns [Integer] 1 if CONNECT protocol is enabled, 0 if disabled.
1373
+ #
1374
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:226
1375
+ def enable_connect_protocol; end
1376
+
1377
+ # Get the current enable push setting.
1378
+ # @returns [Integer] 1 if push is enabled, 0 if disabled.
1379
+ #
1380
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:196
1381
+ def enable_push; end
1382
+
1383
+ # Get the current header table size setting.
1384
+ # @returns [Integer] The header table size in octets.
1385
+ #
1386
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:190
1387
+ def header_table_size; end
1388
+
1389
+ # Get the current initial window size setting.
1390
+ # @returns [Integer] The initial window size in octets.
1391
+ #
1392
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:208
1393
+ def initial_window_size; end
1394
+
1395
+ # Get the current maximum concurrent streams setting.
1396
+ # @returns [Integer] The maximum number of concurrent streams.
1397
+ #
1398
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:202
1399
+ def maximum_concurrent_streams; end
1400
+
1401
+ # Get the current maximum frame size setting.
1402
+ # @returns [Integer] The maximum frame size in octets.
1403
+ #
1404
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:214
1405
+ def maximum_frame_size; end
1406
+
1407
+ # Get the current maximum header list size setting.
1408
+ # @returns [Integer] The maximum header list size in octets.
1409
+ #
1410
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:220
1411
+ def maximum_header_list_size; end
1412
+
1413
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:168
1414
+ def pending; end
1415
+ end
1416
+
1417
+ # The PING frame is a mechanism for measuring a minimal round-trip time from the sender, as well as determining whether an idle connection is still functional. PING frames can be sent from any endpoint.
1418
+ #
1419
+ # +---------------------------------------------------------------+
1420
+ # +---------------------------------------------------------------+
1421
+ #
1422
+ # pkg:gem/protocol-http2#lib/protocol/http2/ping_frame.rb:46
1423
+ class Protocol::HTTP2::PingFrame < ::Protocol::HTTP2::Frame
1424
+ include ::Protocol::HTTP2::Acknowledgement
1425
+
1426
+ # Create an acknowledgement PING frame with the same payload.
1427
+ # @returns [PingFrame] A new PING frame marked as an acknowledgement.
1428
+ #
1429
+ # pkg:gem/protocol-http2#lib/protocol/http2/ping_frame.rb:65
1430
+ def acknowledge; end
1431
+
1432
+ # Apply this PING frame to a connection for processing.
1433
+ # @parameter connection [Connection] The connection to apply the frame to.
1434
+ #
1435
+ # pkg:gem/protocol-http2#lib/protocol/http2/ping_frame.rb:59
1436
+ def apply(connection); end
1437
+
1438
+ # Check if this frame applies to the connection level.
1439
+ # @returns [Boolean] Always returns true for PING frames.
1440
+ #
1441
+ # pkg:gem/protocol-http2#lib/protocol/http2/ping_frame.rb:53
1442
+ def connection?; end
1443
+
1444
+ # Read and validate the PING frame payload.
1445
+ # @parameter stream [IO] The stream to read from.
1446
+ # @raises [ProtocolError] If validation fails.
1447
+ #
1448
+ # pkg:gem/protocol-http2#lib/protocol/http2/ping_frame.rb:76
1449
+ def read_payload(stream); end
1450
+ end
1451
+
1452
+ # pkg:gem/protocol-http2#lib/protocol/http2/ping_frame.rb:47
1453
+ Protocol::HTTP2::PingFrame::TYPE = T.let(T.unsafe(nil), Integer)
1454
+
1455
+ # The PRIORITY_UPDATE frame is used by clients to signal the initial priority of a response, or to reprioritize a response or push stream. It carries the stream ID of the response and the priority in ASCII text, using the same representation as the Priority header field value.
1456
+ #
1457
+ # +-+-------------+-----------------------------------------------+
1458
+ # |R| Prioritized Stream ID (31) |
1459
+ # +-+-----------------------------+-------------------------------+
1460
+ # +---------------------------------------------------------------+
1461
+ #
1462
+ # pkg:gem/protocol-http2#lib/protocol/http2/priority_update_frame.rb:20
1463
+ class Protocol::HTTP2::PriorityUpdateFrame < ::Protocol::HTTP2::Frame
1464
+ # Apply this PRIORITY_UPDATE frame to a connection for processing.
1465
+ # @parameter connection [Connection] The connection to apply the frame to.
1466
+ #
1467
+ # pkg:gem/protocol-http2#lib/protocol/http2/priority_update_frame.rb:44
1468
+ def apply(connection); end
1469
+
1470
+ # Pack the prioritized stream ID and priority field value into the frame.
1471
+ # @parameter prioritized_stream_id [Integer] The stream ID to prioritize.
1472
+ # @parameter data [String] The priority field value.
1473
+ # @parameter options [Hash] Options for packing.
1474
+ #
1475
+ # pkg:gem/protocol-http2#lib/protocol/http2/priority_update_frame.rb:38
1476
+ def pack(prioritized_stream_id, data, **options); end
1477
+
1478
+ # Unpack the prioritized stream ID and priority field value.
1479
+ # @returns [Array] An array containing the prioritized stream ID and priority field value.
1480
+ #
1481
+ # pkg:gem/protocol-http2#lib/protocol/http2/priority_update_frame.rb:26
1482
+ def unpack; end
1483
+ end
1484
+
1485
+ # pkg:gem/protocol-http2#lib/protocol/http2/priority_update_frame.rb:22
1486
+ Protocol::HTTP2::PriorityUpdateFrame::FORMAT = T.let(T.unsafe(nil), String)
1487
+
1488
+ # pkg:gem/protocol-http2#lib/protocol/http2/priority_update_frame.rb:21
1489
+ Protocol::HTTP2::PriorityUpdateFrame::TYPE = T.let(T.unsafe(nil), Integer)
1490
+
1491
+ # Raised by stream or connection handlers, results in GOAWAY frame
1492
+ # which signals termination of the current connection. You *cannot*
1493
+ # recover from this exception, or any exceptions subclassed from it.
1494
+ #
1495
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:91
1496
+ class Protocol::HTTP2::ProtocolError < ::Protocol::HTTP2::Error
1497
+ # Initialize a protocol error with message and error code.
1498
+ # @parameter message [String] The error message.
1499
+ # @parameter code [Integer] The HTTP/2 error code.
1500
+ #
1501
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:102
1502
+ def initialize(message, code = T.unsafe(nil)); end
1503
+
1504
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:108
1505
+ def code; end
1506
+
1507
+ class << self
1508
+ # Build a protocol error for a given HTTP/2 error code.
1509
+ # @parameter code [Integer] The HTTP/2 error code.
1510
+ # @returns [ProtocolError] The protocol error.
1511
+ #
1512
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:95
1513
+ def for(code); end
1514
+ end
1515
+ end
1516
+
1517
+ # The PUSH_PROMISE frame is used to notify the peer endpoint in advance of streams the sender intends to initiate. The PUSH_PROMISE frame includes the unsigned 31-bit identifier of the stream the endpoint plans to create along with a set of headers that provide additional context for the stream.
1518
+ #
1519
+ # +---------------+
1520
+ # |Pad Length? (8)|
1521
+ # +-+-------------+-----------------------------------------------+
1522
+ # |R| Promised Stream ID (31) |
1523
+ # +-+-----------------------------+-------------------------------+
1524
+ # +---------------------------------------------------------------+
1525
+ # +---------------------------------------------------------------+
1526
+ #
1527
+ # pkg:gem/protocol-http2#lib/protocol/http2/push_promise_frame.rb:24
1528
+ class Protocol::HTTP2::PushPromiseFrame < ::Protocol::HTTP2::Frame
1529
+ include ::Protocol::HTTP2::Padded
1530
+ include ::Protocol::HTTP2::Continued
1531
+
1532
+ # Apply this PUSH_PROMISE frame to a connection for processing.
1533
+ # @parameter connection [Connection] The connection to apply the frame to.
1534
+ #
1535
+ # pkg:gem/protocol-http2#lib/protocol/http2/push_promise_frame.rb:51
1536
+ def apply(connection); end
1537
+
1538
+ # Pack the promised stream ID and header block data into the frame.
1539
+ # @parameter stream_id [Integer] The promised stream ID.
1540
+ # @parameter data [String] The header block data.
1541
+ # @parameter arguments [Array] Additional arguments.
1542
+ # @parameter options [Hash] Options for packing.
1543
+ #
1544
+ # pkg:gem/protocol-http2#lib/protocol/http2/push_promise_frame.rb:45
1545
+ def pack(stream_id, data, *arguments, **options); end
1546
+
1547
+ # Unpack the promised stream ID and header block fragment.
1548
+ # @returns [Array] An array containing the promised stream ID and header block data.
1549
+ #
1550
+ # pkg:gem/protocol-http2#lib/protocol/http2/push_promise_frame.rb:32
1551
+ def unpack; end
1552
+ end
1553
+
1554
+ # pkg:gem/protocol-http2#lib/protocol/http2/push_promise_frame.rb:28
1555
+ Protocol::HTTP2::PushPromiseFrame::FORMAT = T.let(T.unsafe(nil), String)
1556
+
1557
+ # pkg:gem/protocol-http2#lib/protocol/http2/push_promise_frame.rb:27
1558
+ Protocol::HTTP2::PushPromiseFrame::TYPE = T.let(T.unsafe(nil), Integer)
1559
+
1560
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:17
1561
+ Protocol::HTTP2::REFUSED_STREAM = T.let(T.unsafe(nil), Integer)
1562
+
1563
+ # The RST_STREAM frame allows for immediate termination of a stream. RST_STREAM is sent to request cancellation of a stream or to indicate that an error condition has occurred.
1564
+ #
1565
+ # +---------------------------------------------------------------+
1566
+ # +---------------------------------------------------------------+
1567
+ #
1568
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:31
1569
+ class Protocol::HTTP2::ResetStreamFrame < ::Protocol::HTTP2::Frame
1570
+ # Apply this RST_STREAM frame to a connection for processing.
1571
+ # @parameter connection [Connection] The connection to apply the frame to.
1572
+ #
1573
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:50
1574
+ def apply(connection); end
1575
+
1576
+ # Pack an error code into the frame payload.
1577
+ # @parameter error_code [Integer] The error code to pack.
1578
+ #
1579
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:43
1580
+ def pack(error_code = T.unsafe(nil)); end
1581
+
1582
+ # Read and validate the RST_STREAM frame payload.
1583
+ # @parameter stream [IO] The stream to read from.
1584
+ # @raises [FrameSizeError] If the frame length is invalid.
1585
+ #
1586
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:57
1587
+ def read_payload(stream); end
1588
+
1589
+ # Unpack the error code from the frame payload.
1590
+ # @returns [Integer] The error code.
1591
+ #
1592
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:37
1593
+ def unpack; end
1594
+ end
1595
+
1596
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:33
1597
+ Protocol::HTTP2::ResetStreamFrame::FORMAT = T.let(T.unsafe(nil), String)
1598
+
1599
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:32
1600
+ Protocol::HTTP2::ResetStreamFrame::TYPE = T.let(T.unsafe(nil), Integer)
1601
+
1602
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:15
1603
+ Protocol::HTTP2::STREAM_CLOSED = T.let(T.unsafe(nil), Integer)
1604
+
1605
+ # Represents an HTTP/2 server connection.
1606
+ # Manages server-side protocol semantics including stream ID allocation,
1607
+ # connection preface handling, and settings negotiation.
1608
+ #
1609
+ # pkg:gem/protocol-http2#lib/protocol/http2/server.rb:13
1610
+ class Protocol::HTTP2::Server < ::Protocol::HTTP2::Connection
1611
+ # Initialize a new HTTP/2 server connection.
1612
+ # @parameter framer [Framer] The frame handler for reading/writing HTTP/2 frames.
1613
+ #
1614
+ # pkg:gem/protocol-http2#lib/protocol/http2/server.rb:16
1615
+ def initialize(framer); end
1616
+
1617
+ # Servers cannot accept push promise streams from clients.
1618
+ # @parameter stream_id [Integer] The stream ID (unused).
1619
+ # @raises [ProtocolError] Always, as servers cannot accept push promises.
1620
+ #
1621
+ # pkg:gem/protocol-http2#lib/protocol/http2/server.rb:67
1622
+ def accept_push_promise_stream(stream_id, &block); end
1623
+
1624
+ # Check if server push is enabled by the client.
1625
+ # @returns [Boolean] True if push promises are enabled.
1626
+ #
1627
+ # pkg:gem/protocol-http2#lib/protocol/http2/server.rb:73
1628
+ def enable_push?; end
1629
+
1630
+ # Check if the given stream ID represents a locally-initiated stream.
1631
+ # Server streams have even numbered IDs.
1632
+ # @parameter id [Integer] The stream ID to check.
1633
+ # @returns [Boolean] True if the stream ID is locally-initiated.
1634
+ #
1635
+ # pkg:gem/protocol-http2#lib/protocol/http2/server.rb:24
1636
+ def local_stream_id?(id); end
1637
+
1638
+ # Read the HTTP/2 connection preface from the client and send initial settings.
1639
+ # This must be called once when the connection is first established.
1640
+ # @parameter settings [Array] Optional settings to send during preface exchange.
1641
+ # @raises [ProtocolError] If called when not in the new state or preface is invalid.
1642
+ #
1643
+ # pkg:gem/protocol-http2#lib/protocol/http2/server.rb:48
1644
+ def read_connection_preface(settings = T.unsafe(nil)); end
1645
+
1646
+ # Check if the given stream ID represents a remotely-initiated stream.
1647
+ # Client streams have odd numbered IDs.
1648
+ # @parameter id [Integer] The stream ID to check.
1649
+ # @returns [Boolean] True if the stream ID is remotely-initiated.
1650
+ #
1651
+ # pkg:gem/protocol-http2#lib/protocol/http2/server.rb:32
1652
+ def remote_stream_id?(id); end
1653
+
1654
+ # Check if the given stream ID is valid for remote initiation.
1655
+ # Client-initiated streams must have odd numbered IDs.
1656
+ # @parameter stream_id [Integer] The stream ID to validate.
1657
+ # @returns [Boolean] True if the stream ID is valid for remote initiation.
1658
+ #
1659
+ # pkg:gem/protocol-http2#lib/protocol/http2/server.rb:40
1660
+ def valid_remote_stream_id?(stream_id); end
1661
+ end
1662
+
1663
+ # HTTP/2 connection settings container and management.
1664
+ #
1665
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:11
1666
+ class Protocol::HTTP2::Settings
1667
+ # Initialize settings with default values from HTTP/2 specification.
1668
+ #
1669
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:35
1670
+ def initialize; end
1671
+
1672
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:107
1673
+ def enable_connect_protocol; end
1674
+
1675
+ # Set the CONNECT protocol enable flag.
1676
+ # @parameter value [Integer] Must be 0 (disabled) or 1 (enabled).
1677
+ # @raises [ProtocolError] If the value is invalid.
1678
+ #
1679
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:112
1680
+ def enable_connect_protocol=(value); end
1681
+
1682
+ # Check if CONNECT protocol is enabled.
1683
+ # @returns [Boolean] True if CONNECT protocol is enabled.
1684
+ #
1685
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:122
1686
+ def enable_connect_protocol?; end
1687
+
1688
+ # This setting can be used to disable server push. An endpoint MUST NOT send a PUSH_PROMISE frame if it receives this parameter set to a value of 0.
1689
+ #
1690
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:52
1691
+ def enable_push; end
1692
+
1693
+ # Set the server push enable flag.
1694
+ # @parameter value [Integer] Must be 0 (disabled) or 1 (enabled).
1695
+ # @raises [ProtocolError] If the value is invalid.
1696
+ #
1697
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:57
1698
+ def enable_push=(value); end
1699
+
1700
+ # Check if server push is enabled.
1701
+ # @returns [Boolean] True if server push is enabled.
1702
+ #
1703
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:67
1704
+ def enable_push?; end
1705
+
1706
+ # Allows the sender to inform the remote endpoint of the maximum size of the header compression table used to decode header blocks, in octets.
1707
+ #
1708
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:49
1709
+ def header_table_size; end
1710
+
1711
+ # Allows the sender to inform the remote endpoint of the maximum size of the header compression table used to decode header blocks, in octets.
1712
+ #
1713
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:49
1714
+ def header_table_size=(_arg0); end
1715
+
1716
+ # Indicates the sender's initial window size (in octets) for stream-level flow control.
1717
+ #
1718
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:75
1719
+ def initial_window_size; end
1720
+
1721
+ # Set the initial window size for stream-level flow control.
1722
+ # @parameter value [Integer] The window size in octets.
1723
+ # @raises [ProtocolError] If the value exceeds the maximum allowed.
1724
+ #
1725
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:80
1726
+ def initial_window_size=(value); end
1727
+
1728
+ # Indicates the maximum number of concurrent streams that the sender will allow.
1729
+ #
1730
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:72
1731
+ def maximum_concurrent_streams; end
1732
+
1733
+ # Indicates the maximum number of concurrent streams that the sender will allow.
1734
+ #
1735
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:72
1736
+ def maximum_concurrent_streams=(_arg0); end
1737
+
1738
+ # Indicates the size of the largest frame payload that the sender is willing to receive, in octets.
1739
+ #
1740
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:89
1741
+ def maximum_frame_size; end
1742
+
1743
+ # Set the maximum frame size the sender is willing to receive.
1744
+ # @parameter value [Integer] The maximum frame size in octets.
1745
+ # @raises [ProtocolError] If the value is outside the allowed range.
1746
+ #
1747
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:94
1748
+ def maximum_frame_size=(value); end
1749
+
1750
+ # This advisory setting informs a peer of the maximum size of header list that the sender is prepared to accept, in octets.
1751
+ #
1752
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:105
1753
+ def maximum_header_list_size; end
1754
+
1755
+ # This advisory setting informs a peer of the maximum size of header list that the sender is prepared to accept, in octets.
1756
+ #
1757
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:105
1758
+ def maximum_header_list_size=(_arg0); end
1759
+
1760
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:126
1761
+ def no_rfc7540_priorities; end
1762
+
1763
+ # Set the RFC 7540 priorities disable flag.
1764
+ # @parameter value [Integer] Must be 0 (enabled) or 1 (disabled).
1765
+ # @raises [ProtocolError] If the value is invalid.
1766
+ #
1767
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:131
1768
+ def no_rfc7540_priorities=(value); end
1769
+
1770
+ # Check if RFC 7540 priorities are disabled.
1771
+ # @returns [Boolean] True if RFC 7540 priorities are disabled.
1772
+ #
1773
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:141
1774
+ def no_rfc7540_priorities?; end
1775
+
1776
+ # Update settings with a hash of changes.
1777
+ # @parameter changes [Hash] Hash of setting keys and values to update.
1778
+ #
1779
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:147
1780
+ def update(changes); end
1781
+ end
1782
+
1783
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:21
1784
+ Protocol::HTTP2::Settings::ASSIGN = T.let(T.unsafe(nil), Array)
1785
+
1786
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:18
1787
+ Protocol::HTTP2::Settings::ENABLE_CONNECT_PROTOCOL = T.let(T.unsafe(nil), Integer)
1788
+
1789
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:13
1790
+ Protocol::HTTP2::Settings::ENABLE_PUSH = T.let(T.unsafe(nil), Integer)
1791
+
1792
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:12
1793
+ Protocol::HTTP2::Settings::HEADER_TABLE_SIZE = T.let(T.unsafe(nil), Integer)
1794
+
1795
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:15
1796
+ Protocol::HTTP2::Settings::INITIAL_WINDOW_SIZE = T.let(T.unsafe(nil), Integer)
1797
+
1798
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:14
1799
+ Protocol::HTTP2::Settings::MAXIMUM_CONCURRENT_STREAMS = T.let(T.unsafe(nil), Integer)
1800
+
1801
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:16
1802
+ Protocol::HTTP2::Settings::MAXIMUM_FRAME_SIZE = T.let(T.unsafe(nil), Integer)
1803
+
1804
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:17
1805
+ Protocol::HTTP2::Settings::MAXIMUM_HEADER_LIST_SIZE = T.let(T.unsafe(nil), Integer)
1806
+
1807
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:19
1808
+ Protocol::HTTP2::Settings::NO_RFC7540_PRIORITIES = T.let(T.unsafe(nil), Integer)
1809
+
1810
+ # The SETTINGS frame conveys configuration parameters that affect how endpoints communicate, such as preferences and constraints on peer behavior. The SETTINGS frame is also used to acknowledge the receipt of those parameters. Individually, a SETTINGS parameter can also be referred to as a "setting".
1811
+ #
1812
+ # +-------------------------------+
1813
+ # +-------------------------------+-------------------------------+
1814
+ # +---------------------------------------------------------------+
1815
+ #
1816
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:239
1817
+ class Protocol::HTTP2::SettingsFrame < ::Protocol::HTTP2::Frame
1818
+ include ::Protocol::HTTP2::Acknowledgement
1819
+
1820
+ # Apply this SETTINGS frame to a connection for processing.
1821
+ # @parameter connection [Connection] The connection to apply the frame to.
1822
+ #
1823
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:270
1824
+ def apply(connection); end
1825
+
1826
+ # Check if this frame applies to the connection level.
1827
+ # @returns [Boolean] Always returns true for SETTINGS frames.
1828
+ #
1829
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:247
1830
+ def connection?; end
1831
+
1832
+ # Pack settings parameters into the frame payload.
1833
+ # @parameter settings [Array] Array of [key, value] pairs to pack.
1834
+ #
1835
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:264
1836
+ def pack(settings = T.unsafe(nil)); end
1837
+
1838
+ # Read and validate the SETTINGS frame payload.
1839
+ # @parameter stream [IO] The stream to read from.
1840
+ # @raises [ProtocolError] If the frame is invalid.
1841
+ # @raises [FrameSizeError] If the frame length is invalid.
1842
+ #
1843
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:278
1844
+ def read_payload(stream); end
1845
+
1846
+ # Unpack settings parameters from the frame payload.
1847
+ # @returns [Array] Array of [key, value] pairs representing settings.
1848
+ #
1849
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:253
1850
+ def unpack; end
1851
+ end
1852
+
1853
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:241
1854
+ Protocol::HTTP2::SettingsFrame::FORMAT = T.let(T.unsafe(nil), String)
1855
+
1856
+ # pkg:gem/protocol-http2#lib/protocol/http2/settings_frame.rb:240
1857
+ Protocol::HTTP2::SettingsFrame::TYPE = T.let(T.unsafe(nil), Integer)
1858
+
1859
+ # A single HTTP/2 connection can multiplex multiple streams in parallel:
1860
+ # multiple requests and responses can be in flight simultaneously and stream
1861
+ # data can be interleaved and prioritized.
1862
+ #
1863
+ # This class encapsulates all of the state, transition, flow-control, and
1864
+ # error management as defined by the HTTP 2.0 specification. All you have
1865
+ # to do is subscribe to appropriate events (marked with ":" prefix in
1866
+ # diagram below) and provide your application logic to handle request
1867
+ # and response processing.
1868
+ #
1869
+ # ```
1870
+ # ┌────────┐
1871
+ # send PP │ │ recv PP
1872
+ # ┌──────────┤ idle ├──────────┐
1873
+ # │ │ │ │
1874
+ # ▼ └───┬────┘ ▼
1875
+ # ┌──────────┐ │ ┌──────────┐
1876
+ # │ │ │ send H / │ │
1877
+ # ┌──────┼ reserved │ │ recv H │ reserved ├──────┐
1878
+ # │ │ (local) │ │ │ (remote) │ │
1879
+ # │ └───┬──────┘ ▼ └──────┬───┘ │
1880
+ # │ │ ┌────────┐ │ │
1881
+ # │ │ recv ES │ │ send ES │ │
1882
+ # │ send H │ ┌─────────┤ open ├─────────┐ │ recv H │
1883
+ # │ │ │ │ │ │ │ │
1884
+ # │ ▼ ▼ └───┬────┘ ▼ ▼ │
1885
+ # │ ┌──────────┐ │ ┌──────────┐ │
1886
+ # │ │ half │ │ │ half │ │
1887
+ # │ │ closed │ │ send R / │ closed │ │
1888
+ # │ │ (remote) │ │ recv R │ (local) │ │
1889
+ # │ └────┬─────┘ │ └─────┬────┘ │
1890
+ # │ │ │ │ │
1891
+ # │ │ send ES / │ recv ES / │ │
1892
+ # │ │ send R / ▼ send R / │ │
1893
+ # │ │ recv R ┌────────┐ recv R │ │
1894
+ # │ send R / └───────────►│ │◄───────────┘ send R / │
1895
+ # │ recv R │ closed │ recv R │
1896
+ # └───────────────────────►│ │◄───────────────────────┘
1897
+ # └────────┘
1898
+ # ```
1899
+ #
1900
+ # - `send`: endpoint sends this frame
1901
+ # - `recv`: endpoint receives this frame
1902
+ #
1903
+ # - H: HEADERS frame (with implied CONTINUATIONs)
1904
+ # - PP: PUSH_PROMISE frame (with implied CONTINUATIONs)
1905
+ # - ES: END_STREAM flag
1906
+ # - R: RST_STREAM frame
1907
+ #
1908
+ # State transition methods use a trailing "!".
1909
+ #
1910
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:60
1911
+ class Protocol::HTTP2::Stream
1912
+ include ::Protocol::HTTP2::FlowControlled
1913
+
1914
+ # Initialize a new stream.
1915
+ # @parameter connection [Connection] The connection this stream belongs to.
1916
+ # @parameter id [Integer] The stream identifier.
1917
+ # @parameter state [Symbol] The initial stream state.
1918
+ #
1919
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:79
1920
+ def initialize(connection, id, state = T.unsafe(nil)); end
1921
+
1922
+ # Override this function to implement your own push promise logic.
1923
+ #
1924
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:447
1925
+ def accept_push_promise_stream(stream_id, headers); end
1926
+
1927
+ # Check if the stream is active (not idle or closed).
1928
+ # @returns [Boolean] True if the stream is active.
1929
+ #
1930
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:120
1931
+ def active?; end
1932
+
1933
+ # Transition directly to closed state. Do not pass go, do not collect $200.
1934
+ # This method should only be used by `Connection#close`.
1935
+ #
1936
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:132
1937
+ def close(error = T.unsafe(nil)); end
1938
+
1939
+ # Transition the stream into the closed state.
1940
+ # @parameter error_code [Integer | Nil] The error code if the stream was closed due to a stream reset.
1941
+ #
1942
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:248
1943
+ def close!(error_code = T.unsafe(nil)); end
1944
+
1945
+ # The stream has been closed. If closed due to a stream reset with a non-zero error code, the error will be set.
1946
+ #
1947
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:243
1948
+ def closed(error = T.unsafe(nil)); end
1949
+
1950
+ # Check if the stream is closed.
1951
+ # @returns [Boolean] True if the stream is in closed state.
1952
+ #
1953
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:126
1954
+ def closed?; end
1955
+
1956
+ # The connection this stream belongs to.
1957
+ #
1958
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:92
1959
+ def connection; end
1960
+
1961
+ # Consume from the remote window for both stream and connection.
1962
+ # @parameter frame [Frame] The frame that consumes window space.
1963
+ #
1964
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:191
1965
+ def consume_remote_window(frame); end
1966
+
1967
+ # Override this function to implement your own push promise logic.
1968
+ #
1969
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:425
1970
+ def create_push_promise_stream(headers); end
1971
+
1972
+ # Stream ID (odd for client initiated streams, even otherwise).
1973
+ #
1974
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:95
1975
+ def id; end
1976
+
1977
+ # Ignore data frame when in an invalid state.
1978
+ # @parameter frame [DataFrame] The data frame to ignore.
1979
+ #
1980
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:334
1981
+ def ignore_data(frame); end
1982
+
1983
+ # Get a string representation of the stream.
1984
+ # @returns [String] Human-readable stream information.
1985
+ #
1986
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:465
1987
+ def inspect; end
1988
+
1989
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:100
1990
+ def local_window; end
1991
+
1992
+ # Get the maximum frame size for this stream.
1993
+ # @returns [Integer] The maximum frame size from connection settings.
1994
+ #
1995
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:108
1996
+ def maximum_frame_size; end
1997
+
1998
+ # Open the stream by transitioning from idle to open state.
1999
+ # @returns [Stream] Returns self for chaining.
2000
+ # @raises [ProtocolError] If the stream cannot be opened from current state.
2001
+ #
2002
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:232
2003
+ def open!; end
2004
+
2005
+ # @attribute [Protocol::HTTP::Header::Priority | Nil] the priority of the stream.
2006
+ #
2007
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:104
2008
+ def priority; end
2009
+
2010
+ # @attribute [Protocol::HTTP::Header::Priority | Nil] the priority of the stream.
2011
+ #
2012
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:104
2013
+ def priority=(_arg0); end
2014
+
2015
+ # @return [String] the data that was received.
2016
+ #
2017
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:328
2018
+ def process_data(frame); end
2019
+
2020
+ # Process headers frame and decode the header block.
2021
+ # @parameter frame [HeadersFrame] The headers frame to process.
2022
+ # @returns [Array] The decoded headers.
2023
+ #
2024
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:282
2025
+ def process_headers(frame); end
2026
+
2027
+ # DATA frames are subject to flow control and can only be sent when a stream is in the "open" or "half-closed (remote)" state. The entire DATA frame payload is included in flow control, including the Pad Length and Padding fields if present. If a DATA frame is received whose stream is not in "open" or "half-closed (local)" state, the recipient MUST respond with a stream error of type STREAM_CLOSED.
2028
+ #
2029
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:339
2030
+ def receive_data(frame); end
2031
+
2032
+ # Receive and process a headers frame on this stream.
2033
+ # @parameter frame [HeadersFrame] The headers frame to receive.
2034
+ #
2035
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:295
2036
+ def receive_headers(frame); end
2037
+
2038
+ # Receive and process a PUSH_PROMISE frame on this stream.
2039
+ # @parameter frame [PushPromiseFrame] The push promise frame to receive.
2040
+ #
2041
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:453
2042
+ def receive_push_promise(frame); end
2043
+
2044
+ # Receive and process a RST_STREAM frame on this stream.
2045
+ # @parameter frame [ResetStreamFrame] The reset stream frame to receive.
2046
+ # @returns [Integer] The error code from the reset frame.
2047
+ # @raises [ProtocolError] If reset is received on an idle stream.
2048
+ #
2049
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:368
2050
+ def receive_reset_stream(frame); end
2051
+
2052
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:101
2053
+ def remote_window; end
2054
+
2055
+ # Transition stream to reserved local state.
2056
+ # @returns [Stream] Returns self for chaining.
2057
+ # @raises [ProtocolError] If the stream cannot be reserved from current state.
2058
+ #
2059
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:401
2060
+ def reserved_local!; end
2061
+
2062
+ # Transition stream to reserved remote state.
2063
+ # @returns [Stream] Returns self for chaining.
2064
+ # @raises [ProtocolError] If the stream cannot be reserved from current state.
2065
+ #
2066
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:414
2067
+ def reserved_remote!; end
2068
+
2069
+ # Send data over this stream.
2070
+ # @parameter arguments [Array] Arguments passed to write_data.
2071
+ # @parameter options [Hash] Options passed to write_data.
2072
+ #
2073
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:211
2074
+ def send_data(*arguments, **options); end
2075
+
2076
+ # The HEADERS frame is used to open a stream, and additionally carries a header block fragment. HEADERS frames can be sent on a stream in the "idle", "reserved (local)", "open", or "half-closed (remote)" state.
2077
+ #
2078
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:159
2079
+ def send_headers(*arguments); end
2080
+
2081
+ # HEADERS frames can be sent on a stream in the "idle", "reserved (local)", "open", or "half-closed (remote)" state. Despite it's name, it can also be used for trailers.
2082
+ #
2083
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:140
2084
+ def send_headers?; end
2085
+
2086
+ # Server push is semantically equivalent to a server responding to a request; however, in this case, that request is also sent by the server, as a PUSH_PROMISE frame.
2087
+ # @parameter headers [Hash] contains a complete set of request header fields that the server attributes to the request.
2088
+ #
2089
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:431
2090
+ def send_push_promise(headers); end
2091
+
2092
+ # Send a RST_STREAM frame to reset this stream.
2093
+ # @parameter error_code [Integer] The error code to send.
2094
+ #
2095
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:266
2096
+ def send_reset_stream(error_code = T.unsafe(nil)); end
2097
+
2098
+ # Stream state, e.g. `idle`, `closed`.
2099
+ #
2100
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:98
2101
+ def state; end
2102
+
2103
+ # Stream state, e.g. `idle`, `closed`.
2104
+ #
2105
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:98
2106
+ def state=(_arg0); end
2107
+
2108
+ # Write a frame to the connection for this stream.
2109
+ # @parameter frame [Frame] The frame to write.
2110
+ #
2111
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:114
2112
+ def write_frame(frame); end
2113
+
2114
+ protected
2115
+
2116
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:289
2117
+ def ignore_headers(frame); end
2118
+
2119
+ private
2120
+
2121
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:197
2122
+ def write_data(data, flags = T.unsafe(nil), **options); end
2123
+
2124
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:144
2125
+ def write_headers(headers, flags = T.unsafe(nil)); end
2126
+
2127
+ # A normal request is client request -> server response -> client.
2128
+ # A push promise is server request -> client -> server response -> client.
2129
+ # The server generates the same set of headers as if the client was sending a request, and sends these to the client. The client can reject the request by resetting the (new) stream. Otherwise, the server will start sending a response as if the client had send the request.
2130
+ #
2131
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:384
2132
+ def write_push_promise(stream_id, headers, flags = T.unsafe(nil), **options); end
2133
+
2134
+ class << self
2135
+ # Create a new stream and add it to the connection.
2136
+ # @parameter connection [Connection] The connection this stream belongs to.
2137
+ # @parameter id [Integer] The stream identifier.
2138
+ # @returns [Stream] The newly created stream.
2139
+ #
2140
+ # pkg:gem/protocol-http2#lib/protocol/http2/stream.rb:67
2141
+ def create(connection, id); end
2142
+ end
2143
+ end
2144
+
2145
+ # Represents an error for operations on closed streams.
2146
+ #
2147
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:116
2148
+ class Protocol::HTTP2::StreamClosed < ::Protocol::HTTP2::StreamError
2149
+ # Initialize a stream closed error.
2150
+ # @parameter message [String] The error message.
2151
+ #
2152
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:119
2153
+ def initialize(message); end
2154
+ end
2155
+
2156
+ # Represents an error specific to stream operations.
2157
+ #
2158
+ # pkg:gem/protocol-http2#lib/protocol/http2/error.rb:112
2159
+ class Protocol::HTTP2::StreamError < ::Protocol::HTTP2::ProtocolError; end
2160
+
2161
+ # pkg:gem/protocol-http2#lib/protocol/http2/reset_stream_frame.rb:14
2162
+ Protocol::HTTP2::TIMEOUT = T.let(T.unsafe(nil), Integer)
2163
+
2164
+ # Flow control window for managing HTTP/2 data flow.
2165
+ #
2166
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:9
2167
+ class Protocol::HTTP2::Window
2168
+ # Initialize a new flow control window.
2169
+ # @parameter capacity [Integer] The initial window size, typically from the settings.
2170
+ #
2171
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:15
2172
+ def initialize(capacity = T.unsafe(nil)); end
2173
+
2174
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:52
2175
+ def available; end
2176
+
2177
+ # Check if there is available window capacity.
2178
+ # @returns [Boolean] True if there is available capacity.
2179
+ #
2180
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:56
2181
+ def available?; end
2182
+
2183
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:30
2184
+ def capacity; end
2185
+
2186
+ # When the value of SETTINGS_INITIAL_WINDOW_SIZE changes, a receiver MUST adjust the size of all stream flow-control windows that it maintains by the difference between the new value and the old value.
2187
+ #
2188
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:33
2189
+ def capacity=(value); end
2190
+
2191
+ # Consume a specific amount from the available window.
2192
+ # @parameter amount [Integer] The amount to consume from the window.
2193
+ #
2194
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:47
2195
+ def consume(amount); end
2196
+
2197
+ # Expand the window by a specific amount.
2198
+ # @parameter amount [Integer] The amount to expand the window by.
2199
+ # @raises [FlowControlError] If expansion would cause overflow.
2200
+ #
2201
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:63
2202
+ def expand(amount); end
2203
+
2204
+ # The window is completely full?
2205
+ #
2206
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:25
2207
+ def full?; end
2208
+
2209
+ # Get a string representation of the window.
2210
+ # @returns [String] Human-readable window information.
2211
+ #
2212
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:89
2213
+ def inspect; end
2214
+
2215
+ # Check if the window is limited and needs updating.
2216
+ # @returns [Boolean] True if available capacity is less than half of total capacity.
2217
+ #
2218
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:83
2219
+ def limited?; end
2220
+
2221
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:93
2222
+ def to_s; end
2223
+
2224
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:29
2225
+ def used; end
2226
+
2227
+ # Get the amount of window that should be reclaimed.
2228
+ # @returns [Integer] The amount of used window space.
2229
+ #
2230
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:77
2231
+ def wanted; end
2232
+ end
2233
+
2234
+ # When an HTTP/2 connection is first established, new streams are created with an initial flow-control window size of 65,535 octets. The connection flow-control window is also 65,535 octets.
2235
+ #
2236
+ # pkg:gem/protocol-http2#lib/protocol/http2/window.rb:11
2237
+ Protocol::HTTP2::Window::DEFAULT_CAPACITY = T.let(T.unsafe(nil), Integer)
2238
+
2239
+ # The WINDOW_UPDATE frame is used to implement flow control.
2240
+ #
2241
+ # +-+-------------------------------------------------------------+
2242
+ # |R| Window Size Increment (31) |
2243
+ # +-+-------------------------------------------------------------+
2244
+ #
2245
+ # pkg:gem/protocol-http2#lib/protocol/http2/window_update_frame.rb:17
2246
+ class Protocol::HTTP2::WindowUpdateFrame < ::Protocol::HTTP2::Frame
2247
+ # Apply this WINDOW_UPDATE frame to a connection for processing.
2248
+ # @parameter connection [Connection] The connection to apply the frame to.
2249
+ #
2250
+ # pkg:gem/protocol-http2#lib/protocol/http2/window_update_frame.rb:46
2251
+ def apply(connection); end
2252
+
2253
+ # Pack a window size increment into the frame.
2254
+ # @parameter window_size_increment [Integer] The window size increment value.
2255
+ #
2256
+ # pkg:gem/protocol-http2#lib/protocol/http2/window_update_frame.rb:23
2257
+ def pack(window_size_increment); end
2258
+
2259
+ # Read and validate the WINDOW_UPDATE frame payload.
2260
+ # @parameter stream [IO] The stream to read from.
2261
+ # @raises [FrameSizeError] If the frame length is invalid.
2262
+ #
2263
+ # pkg:gem/protocol-http2#lib/protocol/http2/window_update_frame.rb:36
2264
+ def read_payload(stream); end
2265
+
2266
+ # Unpack the window size increment from the frame payload.
2267
+ # @returns [Integer] The window size increment value.
2268
+ #
2269
+ # pkg:gem/protocol-http2#lib/protocol/http2/window_update_frame.rb:29
2270
+ def unpack; end
2271
+ end
2272
+
2273
+ # pkg:gem/protocol-http2#lib/protocol/http2/window_update_frame.rb:19
2274
+ Protocol::HTTP2::WindowUpdateFrame::FORMAT = T.let(T.unsafe(nil), String)
2275
+
2276
+ # pkg:gem/protocol-http2#lib/protocol/http2/window_update_frame.rb:18
2277
+ Protocol::HTTP2::WindowUpdateFrame::TYPE = T.let(T.unsafe(nil), Integer)