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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +35 -0
- data/lib/e621stream/client/options.rb +20 -0
- data/lib/e621stream/client.rb +211 -0
- data/lib/e621stream/close_codes.rb +23 -0
- data/lib/e621stream/event.rb +24 -0
- data/lib/e621stream/events.rb +29 -0
- data/lib/e621stream/stream_error.rb +18 -0
- data/lib/e621stream/version.rb +5 -0
- data/lib/e621stream.rb +18 -0
- data/sorbet/config +6 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/minitest.rbi +120 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/ast@2.4.3.rbi +550 -0
- data/sorbet/rbi/gems/async-http@0.105.0.rbi +1649 -0
- data/sorbet/rbi/gems/async-pool@0.12.0.rbi +219 -0
- data/sorbet/rbi/gems/async-websocket@0.30.2.rbi +271 -0
- data/sorbet/rbi/gems/async@2.46.0.rbi +2193 -0
- data/sorbet/rbi/gems/benchmark@0.5.0.rbi +495 -0
- data/sorbet/rbi/gems/console@1.38.0.rbi +1552 -0
- data/sorbet/rbi/gems/erb@6.0.7.rbi +1581 -0
- data/sorbet/rbi/gems/erubi@1.13.1.rbi +153 -0
- data/sorbet/rbi/gems/fiber-annotation@0.2.0.rbi +62 -0
- data/sorbet/rbi/gems/fiber-local@1.1.0.rbi +36 -0
- data/sorbet/rbi/gems/fiber-storage@1.0.1.rbi +43 -0
- data/sorbet/rbi/gems/io-console@0.9.5.rbi +9 -0
- data/sorbet/rbi/gems/io-endpoint@0.19.0.rbi +1079 -0
- data/sorbet/rbi/gems/io-event@1.22.3.rbi +971 -0
- data/sorbet/rbi/gems/io-stream@0.14.0.rbi +805 -0
- data/sorbet/rbi/gems/json@3.1.0.rbi +1929 -0
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.6.rbi +9 -0
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
- data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
- data/sorbet/rbi/gems/minitest@5.27.0.rbi +1499 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +147 -0
- data/sorbet/rbi/gems/openssl@4.0.2.rbi +4366 -0
- data/sorbet/rbi/gems/parallel@2.3.0.rbi +332 -0
- data/sorbet/rbi/gems/parser@3.3.13.0.rbi +5146 -0
- data/sorbet/rbi/gems/pp@0.6.4.rbi +373 -0
- data/sorbet/rbi/gems/prettyprint@0.2.1.rbi +476 -0
- data/sorbet/rbi/gems/prism@1.9.0.rbi +42213 -0
- data/sorbet/rbi/gems/protocol-hpack@1.5.1.rbi +418 -0
- data/sorbet/rbi/gems/protocol-http1@0.41.1.rbi +894 -0
- data/sorbet/rbi/gems/protocol-http2@0.29.2.rbi +2277 -0
- data/sorbet/rbi/gems/protocol-http@0.72.1.rbi +3801 -0
- data/sorbet/rbi/gems/protocol-rack@0.23.0.rbi +9 -0
- data/sorbet/rbi/gems/protocol-url@0.19.0.rbi +9 -0
- data/sorbet/rbi/gems/protocol-websocket@0.21.3.rbi +1087 -0
- data/sorbet/rbi/gems/racc@1.8.1.rbi +169 -0
- data/sorbet/rbi/gems/rack@3.2.8.rbi +9 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +362 -0
- data/sorbet/rbi/gems/rake@13.4.2.rbi +3127 -0
- data/sorbet/rbi/gems/rbi@0.5.0.rbi +5875 -0
- data/sorbet/rbi/gems/rbs@4.2.0.rbi +7133 -0
- data/sorbet/rbi/gems/rdoc@8.1.0.rbi +9 -0
- data/sorbet/rbi/gems/regexp_parser@2.13.1.rbi +3500 -0
- data/sorbet/rbi/gems/reline@0.7.0.rbi +2449 -0
- data/sorbet/rbi/gems/require-hooks@0.5.1.rbi +152 -0
- data/sorbet/rbi/gems/rexml@3.4.4.rbi +4905 -0
- data/sorbet/rbi/gems/rubocop-ast@1.51.0.rbi +7230 -0
- data/sorbet/rbi/gems/rubocop-rake@0.7.1.rbi +314 -0
- data/sorbet/rbi/gems/rubocop@1.92.2.rbi +69094 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
- data/sorbet/rbi/gems/rubydex@0.4.4.rbi +1620 -0
- data/sorbet/rbi/gems/spoom@1.8.13.rbi +7380 -0
- data/sorbet/rbi/gems/tapioca@0.20.0.rbi +3752 -0
- data/sorbet/rbi/gems/thor@1.5.0.rbi +3870 -0
- data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
- data/sorbet/rbi/gems/unicode-display_width@3.3.0.rbi +130 -0
- data/sorbet/rbi/gems/unicode-emoji@4.3.0.rbi +254 -0
- data/sorbet/rbi/gems/zeitwerk@2.8.3.rbi +1178 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- metadata +175 -0
|
@@ -0,0 +1,805 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
|
|
3
|
+
# DO NOT EDIT MANUALLY
|
|
4
|
+
# This is an autogenerated file for types exported from the `io-stream` gem.
|
|
5
|
+
# Please instead update this file by running `bin/tapioca gem io-stream`.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Socket extensions for buffering support.
|
|
9
|
+
#
|
|
10
|
+
# pkg:gem/io-stream#lib/io/stream/shim/buffered.rb:26
|
|
11
|
+
class BasicSocket < ::IO
|
|
12
|
+
# Set the buffered state of the socket.
|
|
13
|
+
# @parameter value [Boolean] True to enable buffering, false to disable.
|
|
14
|
+
#
|
|
15
|
+
# pkg:gem/io-stream#lib/io/stream/shim/buffered.rb:49
|
|
16
|
+
def buffered=(value); end
|
|
17
|
+
|
|
18
|
+
# Check if the socket is buffered.
|
|
19
|
+
# @returns [Boolean] True if the socket is buffered.
|
|
20
|
+
#
|
|
21
|
+
# pkg:gem/io-stream#lib/io/stream/shim/buffered.rb:37
|
|
22
|
+
def buffered?; end
|
|
23
|
+
|
|
24
|
+
# Check if this socket uses TCP protocol.
|
|
25
|
+
# @returns [Boolean] True if the socket is TCP over IPv4 or IPv6.
|
|
26
|
+
#
|
|
27
|
+
# pkg:gem/io-stream#lib/io/stream/shim/buffered.rb:29
|
|
28
|
+
def ip_protocol_tcp?; end
|
|
29
|
+
|
|
30
|
+
# Check if the socket is readable.
|
|
31
|
+
# @returns [Boolean] True if the socket is readable.
|
|
32
|
+
#
|
|
33
|
+
# pkg:gem/io-stream#lib/io/stream/shim/readable.rb:23
|
|
34
|
+
def readable?; end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# @namespace
|
|
38
|
+
# Released under the MIT License.
|
|
39
|
+
# Copyright, 2023-2025, by Samuel Williams.
|
|
40
|
+
#
|
|
41
|
+
# pkg:gem/io-stream#lib/io/stream/shim/buffered.rb:7
|
|
42
|
+
class IO
|
|
43
|
+
include ::Enumerable
|
|
44
|
+
include ::File::Constants
|
|
45
|
+
|
|
46
|
+
# Set the buffered state of the IO.
|
|
47
|
+
# @parameter value [Boolean] True to enable buffering, false to disable.
|
|
48
|
+
#
|
|
49
|
+
# pkg:gem/io-stream#lib/io/stream/shim/buffered.rb:16
|
|
50
|
+
def buffered=(value); end
|
|
51
|
+
|
|
52
|
+
# Check if the IO is buffered.
|
|
53
|
+
# @returns [Boolean] True if the IO is buffered (not synchronized).
|
|
54
|
+
#
|
|
55
|
+
# pkg:gem/io-stream#lib/io/stream/shim/buffered.rb:10
|
|
56
|
+
def buffered?; end
|
|
57
|
+
|
|
58
|
+
# Check if the IO is readable.
|
|
59
|
+
# @returns [Boolean] True if the IO is readable (not closed).
|
|
60
|
+
#
|
|
61
|
+
# pkg:gem/io-stream#lib/io/stream/shim/readable.rb:10
|
|
62
|
+
def readable?; end
|
|
63
|
+
|
|
64
|
+
class << self
|
|
65
|
+
# Convert any IO-like object into a buffered stream.
|
|
66
|
+
# @parameter io [IO] The IO object to wrap.
|
|
67
|
+
# @returns [IO::Stream::Buffered] A buffered stream wrapper.
|
|
68
|
+
#
|
|
69
|
+
# pkg:gem/io-stream#lib/io/stream.rb:15
|
|
70
|
+
def Stream(io); end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
class IO::Buffer
|
|
75
|
+
include ::Comparable
|
|
76
|
+
|
|
77
|
+
def initialize(*_arg0); end
|
|
78
|
+
|
|
79
|
+
def &(_arg0); end
|
|
80
|
+
def <=>(_arg0); end
|
|
81
|
+
def ^(_arg0); end
|
|
82
|
+
def and!(_arg0); end
|
|
83
|
+
def clear(*_arg0); end
|
|
84
|
+
def copy(*_arg0); end
|
|
85
|
+
def each(*_arg0); end
|
|
86
|
+
def each_byte(*_arg0); end
|
|
87
|
+
def empty?; end
|
|
88
|
+
def external?; end
|
|
89
|
+
def free; end
|
|
90
|
+
def get_string(*_arg0); end
|
|
91
|
+
def get_value(_arg0, _arg1); end
|
|
92
|
+
def get_values(_arg0, _arg1); end
|
|
93
|
+
def hexdump(*_arg0); end
|
|
94
|
+
def inspect; end
|
|
95
|
+
def internal?; end
|
|
96
|
+
def locked; end
|
|
97
|
+
def locked?; end
|
|
98
|
+
def mapped?; end
|
|
99
|
+
def not!; end
|
|
100
|
+
def null?; end
|
|
101
|
+
def or!(_arg0); end
|
|
102
|
+
def pread(*_arg0); end
|
|
103
|
+
def private?; end
|
|
104
|
+
def pwrite(*_arg0); end
|
|
105
|
+
def read(*_arg0); end
|
|
106
|
+
def readonly?; end
|
|
107
|
+
def resize(_arg0); end
|
|
108
|
+
def set_string(*_arg0); end
|
|
109
|
+
def set_value(_arg0, _arg1, _arg2); end
|
|
110
|
+
def set_values(_arg0, _arg1, _arg2); end
|
|
111
|
+
def shared?; end
|
|
112
|
+
def size; end
|
|
113
|
+
def slice(*_arg0); end
|
|
114
|
+
def to_s; end
|
|
115
|
+
def transfer; end
|
|
116
|
+
def valid?; end
|
|
117
|
+
def values(*_arg0); end
|
|
118
|
+
def write(*_arg0); end
|
|
119
|
+
def xor!(_arg0); end
|
|
120
|
+
def |(_arg0); end
|
|
121
|
+
def ~; end
|
|
122
|
+
|
|
123
|
+
private
|
|
124
|
+
|
|
125
|
+
def initialize_copy(_arg0); end
|
|
126
|
+
|
|
127
|
+
class << self
|
|
128
|
+
def for(_arg0); end
|
|
129
|
+
def map(*_arg0); end
|
|
130
|
+
def size_of(_arg0); end
|
|
131
|
+
def string(_arg0); end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
class IO::Buffer::AccessError < ::RuntimeError; end
|
|
136
|
+
class IO::Buffer::AllocationError < ::RuntimeError; end
|
|
137
|
+
IO::Buffer::BIG_ENDIAN = T.let(T.unsafe(nil), Integer)
|
|
138
|
+
IO::Buffer::DEFAULT_SIZE = T.let(T.unsafe(nil), Integer)
|
|
139
|
+
IO::Buffer::EXTERNAL = T.let(T.unsafe(nil), Integer)
|
|
140
|
+
IO::Buffer::HOST_ENDIAN = T.let(T.unsafe(nil), Integer)
|
|
141
|
+
IO::Buffer::INTERNAL = T.let(T.unsafe(nil), Integer)
|
|
142
|
+
class IO::Buffer::InvalidatedError < ::RuntimeError; end
|
|
143
|
+
IO::Buffer::LITTLE_ENDIAN = T.let(T.unsafe(nil), Integer)
|
|
144
|
+
IO::Buffer::LOCKED = T.let(T.unsafe(nil), Integer)
|
|
145
|
+
class IO::Buffer::LockedError < ::RuntimeError; end
|
|
146
|
+
IO::Buffer::MAPPED = T.let(T.unsafe(nil), Integer)
|
|
147
|
+
class IO::Buffer::MaskError < ::ArgumentError; end
|
|
148
|
+
IO::Buffer::NETWORK_ENDIAN = T.let(T.unsafe(nil), Integer)
|
|
149
|
+
IO::Buffer::PAGE_SIZE = T.let(T.unsafe(nil), Integer)
|
|
150
|
+
IO::Buffer::PRIVATE = T.let(T.unsafe(nil), Integer)
|
|
151
|
+
IO::Buffer::READONLY = T.let(T.unsafe(nil), Integer)
|
|
152
|
+
IO::Buffer::SHARED = T.let(T.unsafe(nil), Integer)
|
|
153
|
+
|
|
154
|
+
class IO::EAGAINWaitReadable < ::Errno::EAGAIN
|
|
155
|
+
include ::IO::WaitReadable
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
class IO::EAGAINWaitWritable < ::Errno::EAGAIN
|
|
159
|
+
include ::IO::WaitWritable
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
class IO::EINPROGRESSWaitReadable < ::Errno::EINPROGRESS
|
|
163
|
+
include ::IO::WaitReadable
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
class IO::EINPROGRESSWaitWritable < ::Errno::EINPROGRESS
|
|
167
|
+
include ::IO::WaitWritable
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
IO::EWOULDBLOCKWaitReadable = IO::EAGAINWaitReadable
|
|
171
|
+
IO::EWOULDBLOCKWaitWritable = IO::EAGAINWaitWritable
|
|
172
|
+
IO::PRIORITY = T.let(T.unsafe(nil), Integer)
|
|
173
|
+
IO::READABLE = T.let(T.unsafe(nil), Integer)
|
|
174
|
+
|
|
175
|
+
# Provides buffered IO streams with consistent read, write, and transport semantics.
|
|
176
|
+
# Released under the MIT License.
|
|
177
|
+
# Copyright, 2025-2026, by Samuel Williams.
|
|
178
|
+
# Released under the MIT License.
|
|
179
|
+
# Copyright, 2026, by Samuel Williams.
|
|
180
|
+
# Released under the MIT License.
|
|
181
|
+
# Copyright, 2023-2025, by Samuel Williams.
|
|
182
|
+
# Released under the MIT License.
|
|
183
|
+
# Copyright, 2023-2026, by Samuel Williams.
|
|
184
|
+
#
|
|
185
|
+
# pkg:gem/io-stream#lib/io/stream/version.rb:6
|
|
186
|
+
module IO::Stream
|
|
187
|
+
class << self
|
|
188
|
+
# Construct a buffered stream from either one duplex IO-like object or two separate endpoints.
|
|
189
|
+
# @parameter input [IO] The duplex IO object, or the readable endpoint.
|
|
190
|
+
# @parameter output [IO | Nil] The writable endpoint, when distinct from the readable endpoint.
|
|
191
|
+
# @parameter options [Hash] Additional options passed to the buffered stream wrapper.
|
|
192
|
+
# @returns [IO::Stream::Buffered] A buffered stream wrapping the supplied transport.
|
|
193
|
+
#
|
|
194
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:115
|
|
195
|
+
def Duplex(input, output = T.unsafe(nil), **options); end
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# The default block size for IO buffers. Defaults to 256KB (optimized for modern SSDs and networks).
|
|
200
|
+
#
|
|
201
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:10
|
|
202
|
+
IO::Stream::BLOCK_SIZE = T.let(T.unsafe(nil), Integer)
|
|
203
|
+
|
|
204
|
+
# A buffered stream implementation that wraps an underlying IO object to provide efficient buffered reading and writing.
|
|
205
|
+
#
|
|
206
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:12
|
|
207
|
+
class IO::Stream::Buffered < ::IO::Stream::Generic
|
|
208
|
+
# Initialize a new buffered stream.
|
|
209
|
+
# @parameter io [IO] The underlying IO object to wrap.
|
|
210
|
+
#
|
|
211
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:54
|
|
212
|
+
def initialize(io, *, **, &); end
|
|
213
|
+
|
|
214
|
+
# Close the read end of the stream.
|
|
215
|
+
#
|
|
216
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:81
|
|
217
|
+
def close_read; end
|
|
218
|
+
|
|
219
|
+
# Close the write end of the stream.
|
|
220
|
+
#
|
|
221
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:86
|
|
222
|
+
def close_write; end
|
|
223
|
+
|
|
224
|
+
# Check if the stream is closed.
|
|
225
|
+
# @returns [Boolean] True if the stream is closed.
|
|
226
|
+
#
|
|
227
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:76
|
|
228
|
+
def closed?; end
|
|
229
|
+
|
|
230
|
+
# @attribute [IO] The wrapped IO object.
|
|
231
|
+
#
|
|
232
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:66
|
|
233
|
+
def io; end
|
|
234
|
+
|
|
235
|
+
# Check if the stream is readable.
|
|
236
|
+
# @returns [Boolean] True if the stream is readable.
|
|
237
|
+
#
|
|
238
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:94
|
|
239
|
+
def readable?; end
|
|
240
|
+
|
|
241
|
+
# Get the underlying IO object.
|
|
242
|
+
# @returns [IO] The underlying IO object.
|
|
243
|
+
#
|
|
244
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:70
|
|
245
|
+
def to_io; end
|
|
246
|
+
|
|
247
|
+
protected
|
|
248
|
+
|
|
249
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:100
|
|
250
|
+
def sysclose; end
|
|
251
|
+
|
|
252
|
+
# Reads data from the underlying stream as efficiently as possible.
|
|
253
|
+
#
|
|
254
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:114
|
|
255
|
+
def sysread(size, buffer); end
|
|
256
|
+
|
|
257
|
+
# Attempts to read data from the underlying stream without blocking.
|
|
258
|
+
#
|
|
259
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:109
|
|
260
|
+
def sysread_nonblock(size, buffer); end
|
|
261
|
+
|
|
262
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:104
|
|
263
|
+
def syswrite(buffer); end
|
|
264
|
+
|
|
265
|
+
class << self
|
|
266
|
+
# Open a file and wrap it in a buffered stream.
|
|
267
|
+
# @parameter path [String] The file path to open.
|
|
268
|
+
# @parameter mode [String] The file mode (e.g., "r+", "w", "a").
|
|
269
|
+
# @parameter options [Hash] Additional options passed to the stream constructor.
|
|
270
|
+
# @returns [IO::Stream::Buffered] A buffered stream wrapping the opened file.
|
|
271
|
+
#
|
|
272
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:18
|
|
273
|
+
def open(path, mode = T.unsafe(nil), **options); end
|
|
274
|
+
|
|
275
|
+
# Wrap an existing IO object in a buffered stream.
|
|
276
|
+
# @parameter io [IO] The IO object to wrap.
|
|
277
|
+
# @parameter options [Hash] Additional options passed to the stream constructor.
|
|
278
|
+
# @returns [IO::Stream::Buffered] A buffered stream wrapping the IO object.
|
|
279
|
+
#
|
|
280
|
+
# pkg:gem/io-stream#lib/io/stream/buffered.rb:34
|
|
281
|
+
def wrap(io, **options); end
|
|
282
|
+
end
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Represents a connection reset error in IO streams, usually occurring when the remote side closes the connection unexpectedly.
|
|
286
|
+
#
|
|
287
|
+
# pkg:gem/io-stream#lib/io/stream/connection_reset_error.rb:8
|
|
288
|
+
class IO::Stream::ConnectionResetError < ::Errno::ECONNRESET; end
|
|
289
|
+
|
|
290
|
+
# A low-level duplex IO adapter that composes distinct readable and writable endpoints.
|
|
291
|
+
#
|
|
292
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:8
|
|
293
|
+
class IO::Stream::Duplex
|
|
294
|
+
# Initialize a duplex transport from separate readable and writable endpoints.
|
|
295
|
+
# @parameter input [IO] The readable endpoint.
|
|
296
|
+
# @parameter output [IO] The writable endpoint.
|
|
297
|
+
#
|
|
298
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:12
|
|
299
|
+
def initialize(input, output = T.unsafe(nil)); end
|
|
300
|
+
|
|
301
|
+
# Close both endpoints.
|
|
302
|
+
#
|
|
303
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:74
|
|
304
|
+
def close; end
|
|
305
|
+
|
|
306
|
+
# Close the readable endpoint.
|
|
307
|
+
#
|
|
308
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:46
|
|
309
|
+
def close_read; end
|
|
310
|
+
|
|
311
|
+
# Close the writable endpoint.
|
|
312
|
+
#
|
|
313
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:57
|
|
314
|
+
def close_write; end
|
|
315
|
+
|
|
316
|
+
# Check whether both endpoints are closed.
|
|
317
|
+
# @returns [Boolean] True if the duplex stream can no longer read or write.
|
|
318
|
+
#
|
|
319
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:41
|
|
320
|
+
def closed?; end
|
|
321
|
+
|
|
322
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:17
|
|
323
|
+
def input; end
|
|
324
|
+
|
|
325
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:18
|
|
326
|
+
def output; end
|
|
327
|
+
|
|
328
|
+
# Read data from the readable endpoint without blocking.
|
|
329
|
+
# @parameter size [Integer] The maximum number of bytes to read.
|
|
330
|
+
# @parameter buffer [String] The destination buffer.
|
|
331
|
+
# @parameter exception [Boolean] Whether to raise on `:wait_readable` and EOF conditions.
|
|
332
|
+
# @returns [String | Symbol | Nil] Data read from the endpoint, or the underlying non-blocking result.
|
|
333
|
+
#
|
|
334
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:91
|
|
335
|
+
def read_nonblock(size, buffer, exception: T.unsafe(nil)); end
|
|
336
|
+
|
|
337
|
+
# Check whether the readable endpoint may still produce data.
|
|
338
|
+
# @returns [Boolean] True if the readable endpoint reports it is readable.
|
|
339
|
+
#
|
|
340
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:69
|
|
341
|
+
def readable?; end
|
|
342
|
+
|
|
343
|
+
# Return the maximum timeout across both endpoints.
|
|
344
|
+
# @returns [Numeric | Nil] The effective timeout, or `nil` if no timeout is configured.
|
|
345
|
+
#
|
|
346
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:28
|
|
347
|
+
def timeout; end
|
|
348
|
+
|
|
349
|
+
# Update the timeout on both endpoints.
|
|
350
|
+
# @parameter duration [Numeric | Nil] The timeout to assign.
|
|
351
|
+
#
|
|
352
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:34
|
|
353
|
+
def timeout=(duration); end
|
|
354
|
+
|
|
355
|
+
# Return the underlying IO used to represent this duplex stream.
|
|
356
|
+
# @returns [IO] The readable endpoint if available, otherwise the writable endpoint.
|
|
357
|
+
#
|
|
358
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:22
|
|
359
|
+
def to_io; end
|
|
360
|
+
|
|
361
|
+
# Wait until the readable endpoint can be read.
|
|
362
|
+
# @parameter duration [Numeric | Nil] The maximum time to wait.
|
|
363
|
+
# @returns [Boolean] True if the endpoint became readable.
|
|
364
|
+
#
|
|
365
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:98
|
|
366
|
+
def wait_readable(duration = T.unsafe(nil)); end
|
|
367
|
+
|
|
368
|
+
# Wait until the writable endpoint can be written.
|
|
369
|
+
# @parameter duration [Numeric | Nil] The maximum time to wait.
|
|
370
|
+
# @returns [Boolean] True if the endpoint became writable.
|
|
371
|
+
#
|
|
372
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:105
|
|
373
|
+
def wait_writable(duration = T.unsafe(nil)); end
|
|
374
|
+
|
|
375
|
+
# Write data to the writable endpoint.
|
|
376
|
+
# @parameter buffer [String] The data to write.
|
|
377
|
+
# @returns [Integer] The number of bytes written.
|
|
378
|
+
#
|
|
379
|
+
# pkg:gem/io-stream#lib/io/stream/duplex.rb:82
|
|
380
|
+
def write(buffer); end
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
# Base class for stream implementations providing common functionality.
|
|
384
|
+
#
|
|
385
|
+
# pkg:gem/io-stream#lib/io/stream/generic.rb:18
|
|
386
|
+
class IO::Stream::Generic
|
|
387
|
+
include ::IO::Stream::Readable
|
|
388
|
+
include ::IO::Stream::Writable
|
|
389
|
+
|
|
390
|
+
# Initialize a new generic stream.
|
|
391
|
+
# @parameter options [Hash] Options passed to included modules.
|
|
392
|
+
#
|
|
393
|
+
# pkg:gem/io-stream#lib/io/stream/generic.rb:32
|
|
394
|
+
def initialize(**options); end
|
|
395
|
+
|
|
396
|
+
# Best effort to flush any unwritten data, and then close the underling IO.
|
|
397
|
+
#
|
|
398
|
+
# pkg:gem/io-stream#lib/io/stream/generic.rb:43
|
|
399
|
+
def close; end
|
|
400
|
+
|
|
401
|
+
# Check if the stream is closed.
|
|
402
|
+
# @returns [Boolean] False by default, should be overridden by subclasses.
|
|
403
|
+
#
|
|
404
|
+
# pkg:gem/io-stream#lib/io/stream/generic.rb:38
|
|
405
|
+
def closed?; end
|
|
406
|
+
|
|
407
|
+
protected
|
|
408
|
+
|
|
409
|
+
# Closes the underlying IO stream.
|
|
410
|
+
# This method should be implemented by subclasses to handle the specific closing logic.
|
|
411
|
+
#
|
|
412
|
+
# pkg:gem/io-stream#lib/io/stream/generic.rb:59
|
|
413
|
+
def sysclose; end
|
|
414
|
+
|
|
415
|
+
# Reads data from the underlying stream as efficiently as possible.
|
|
416
|
+
# This method should be implemented by subclasses to handle the specific reading logic.
|
|
417
|
+
#
|
|
418
|
+
# pkg:gem/io-stream#lib/io/stream/generic.rb:73
|
|
419
|
+
def sysread(size, buffer); end
|
|
420
|
+
|
|
421
|
+
# Writes data to the underlying stream.
|
|
422
|
+
# This method should be implemented by subclasses to handle the specific writing logic.
|
|
423
|
+
# @parameter buffer [String] The data to write.
|
|
424
|
+
# @returns [Integer] The number of bytes written.
|
|
425
|
+
#
|
|
426
|
+
# pkg:gem/io-stream#lib/io/stream/generic.rb:67
|
|
427
|
+
def syswrite(buffer); end
|
|
428
|
+
|
|
429
|
+
class << self
|
|
430
|
+
# Check if a method is async-safe.
|
|
431
|
+
#
|
|
432
|
+
# @parameter method [Symbol] The method name to check.
|
|
433
|
+
# @returns [Symbol | Boolean] The concurrency guard for the given method.
|
|
434
|
+
#
|
|
435
|
+
# pkg:gem/io-stream#lib/io/stream/generic.rb:26
|
|
436
|
+
def async_safe?(method); end
|
|
437
|
+
end
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
# The maximum read size for a single read operation. This limit exists because:
|
|
441
|
+
# 1. System calls like read() cannot handle requests larger than SSIZE_MAX
|
|
442
|
+
# 2. Very large reads can cause memory pressure and poor interactive performance
|
|
443
|
+
# 3. Most socket buffers and pipe capacities are much smaller anyway
|
|
444
|
+
# On 64-bit systems SSIZE_MAX is ~8.8 million MB, on 32-bit it's ~2GB.
|
|
445
|
+
# Our default of 16MB provides a good balance of throughput and responsiveness, and is page aligned.
|
|
446
|
+
# It is also a multiple of the minimum read size, so that we can read in chunks without exceeding the maximum.
|
|
447
|
+
#
|
|
448
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:22
|
|
449
|
+
IO::Stream::MAXIMUM_READ_SIZE = T.let(T.unsafe(nil), Integer)
|
|
450
|
+
|
|
451
|
+
# The minimum read size for efficient I/O operations. Defaults to the same as BLOCK_SIZE.
|
|
452
|
+
#
|
|
453
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:13
|
|
454
|
+
IO::Stream::MINIMUM_READ_SIZE = T.let(T.unsafe(nil), Integer)
|
|
455
|
+
|
|
456
|
+
# The minimum write size before flushing. Defaults to 64KB.
|
|
457
|
+
#
|
|
458
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:10
|
|
459
|
+
IO::Stream::MINIMUM_WRITE_SIZE = T.let(T.unsafe(nil), Integer)
|
|
460
|
+
|
|
461
|
+
# A module providing readable stream functionality.
|
|
462
|
+
#
|
|
463
|
+
# You must implement the `sysread` method to read data from the underlying IO. You may implement `sysread_nonblock` to support non-blocking partial peeks.
|
|
464
|
+
#
|
|
465
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:27
|
|
466
|
+
module IO::Stream::Readable
|
|
467
|
+
# Initialize readable stream functionality.
|
|
468
|
+
# @parameter minimum_read_size [Integer] The minimum size for read operations.
|
|
469
|
+
# @parameter maximum_read_size [Integer] The maximum size for read operations.
|
|
470
|
+
# @parameter block_size [Integer] Legacy parameter, use minimum_read_size instead.
|
|
471
|
+
#
|
|
472
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:58
|
|
473
|
+
def initialize(minimum_read_size: T.unsafe(nil), maximum_read_size: T.unsafe(nil), block_size: T.unsafe(nil), **, &block); end
|
|
474
|
+
|
|
475
|
+
# Legacy accessor for backwards compatibility
|
|
476
|
+
# @returns [Integer] The minimum read size.
|
|
477
|
+
#
|
|
478
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:75
|
|
479
|
+
def block_size; end
|
|
480
|
+
|
|
481
|
+
# Legacy setter for backwards compatibility
|
|
482
|
+
# @parameter value [Integer] The minimum read size.
|
|
483
|
+
#
|
|
484
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:81
|
|
485
|
+
def block_size=(value); end
|
|
486
|
+
|
|
487
|
+
# Close the read end of the stream.
|
|
488
|
+
#
|
|
489
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:398
|
|
490
|
+
def close_read; end
|
|
491
|
+
|
|
492
|
+
# Efficiently discard data from the stream until encountering pattern.
|
|
493
|
+
# @parameter pattern [String] The pattern to match.
|
|
494
|
+
# @parameter offset [Integer] The offset to start searching from.
|
|
495
|
+
# @parameter limit [Integer] The maximum number of bytes to read, including the pattern.
|
|
496
|
+
# @returns [String | Nil] The contents of the stream up until the pattern, or nil if the pattern was not found.
|
|
497
|
+
#
|
|
498
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:229
|
|
499
|
+
def discard_until(pattern, offset = T.unsafe(nil), limit: T.unsafe(nil)); end
|
|
500
|
+
|
|
501
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:378
|
|
502
|
+
def eof!; end
|
|
503
|
+
|
|
504
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:368
|
|
505
|
+
def eof?; end
|
|
506
|
+
|
|
507
|
+
# Mark the stream as finished and raise `EOFError`.
|
|
508
|
+
#
|
|
509
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:371
|
|
510
|
+
def finish!; end
|
|
511
|
+
|
|
512
|
+
# Determins if the stream has consumed all available data. May block if the stream is not readable.
|
|
513
|
+
# See {readable?} for a non-blocking alternative.
|
|
514
|
+
#
|
|
515
|
+
# @returns [Boolean] If the stream is at file which means there is no more data to be read.
|
|
516
|
+
#
|
|
517
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:358
|
|
518
|
+
def finished?; end
|
|
519
|
+
|
|
520
|
+
# Read a line from the stream, similar to IO#gets.
|
|
521
|
+
# @parameter separator [String] The line separator to search for.
|
|
522
|
+
# @parameter limit [Integer | Nil] The maximum number of bytes to read.
|
|
523
|
+
# @parameter chomp [Boolean] Whether to remove the separator from the returned line.
|
|
524
|
+
# @returns [String | Nil] The line read from the stream, or nil if at end of stream.
|
|
525
|
+
#
|
|
526
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:313
|
|
527
|
+
def gets(separator = T.unsafe(nil), limit = T.unsafe(nil), chomp: T.unsafe(nil)); end
|
|
528
|
+
|
|
529
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:71
|
|
530
|
+
def minimum_read_size; end
|
|
531
|
+
|
|
532
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:71
|
|
533
|
+
def minimum_read_size=(_arg0); end
|
|
534
|
+
|
|
535
|
+
# Peek at data in the buffer without consuming it.
|
|
536
|
+
# @parameter size [Integer | Nil] The number of bytes to peek at. If nil, peek at all available data.
|
|
537
|
+
# @returns [String] The data in the buffer without consuming it.
|
|
538
|
+
#
|
|
539
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:249
|
|
540
|
+
def peek(size = T.unsafe(nil)); end
|
|
541
|
+
|
|
542
|
+
# Peek at data without consuming it, making at most one non-blocking read attempt.
|
|
543
|
+
#
|
|
544
|
+
# Any data read from the underlying stream is preserved in the read buffer. If
|
|
545
|
+
# the read would block or the stream is at EOF, this method returns `nil`.
|
|
546
|
+
#
|
|
547
|
+
# After this method returns `nil`, {readable?} indicates whether the read would
|
|
548
|
+
# block or EOF was observed.
|
|
549
|
+
#
|
|
550
|
+
# @parameter size [Integer] The maximum number of bytes to peek at.
|
|
551
|
+
# @returns [String | Nil] The immediately available data, or nil if no data can be read without blocking.
|
|
552
|
+
#
|
|
553
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:283
|
|
554
|
+
def peek_partial(size = T.unsafe(nil)); end
|
|
555
|
+
|
|
556
|
+
# Read data from the stream.
|
|
557
|
+
# @parameter size [Integer | Nil] The number of bytes to read. If nil, read until end of stream.
|
|
558
|
+
# @parameter buffer [String | Nil] An optional buffer to fill with data instead of allocating a new string.
|
|
559
|
+
# @returns [String] The data read from the stream, or the provided buffer filled with data.
|
|
560
|
+
#
|
|
561
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:89
|
|
562
|
+
def read(size = T.unsafe(nil), buffer = T.unsafe(nil)); end
|
|
563
|
+
|
|
564
|
+
# Read exactly the specified number of bytes.
|
|
565
|
+
# @parameter size [Integer] The number of bytes to read.
|
|
566
|
+
# @parameter exception [Class] The exception to raise if not enough data is available.
|
|
567
|
+
# @returns [String] The data read from the stream.
|
|
568
|
+
#
|
|
569
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:154
|
|
570
|
+
def read_exactly(size, buffer = T.unsafe(nil), exception: T.unsafe(nil)); end
|
|
571
|
+
|
|
572
|
+
# Read at most `size` bytes from the stream. Will avoid reading from the underlying stream if possible.
|
|
573
|
+
# @parameter size [Integer | Nil] The number of bytes to read. If nil, read all available data.
|
|
574
|
+
# @parameter buffer [String | Nil] An optional buffer to fill with data instead of allocating a new string.
|
|
575
|
+
# @returns [String] The data read from the stream, or the provided buffer filled with data.
|
|
576
|
+
#
|
|
577
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:132
|
|
578
|
+
def read_partial(size = T.unsafe(nil), buffer = T.unsafe(nil)); end
|
|
579
|
+
|
|
580
|
+
# Efficiently read data from the stream until encountering pattern.
|
|
581
|
+
# @parameter pattern [String] The pattern to match.
|
|
582
|
+
# @parameter offset [Integer] The offset to start searching from.
|
|
583
|
+
# @parameter limit [Integer] The maximum number of bytes to read, including the pattern (even if chomped).
|
|
584
|
+
# @parameter chomp [Boolean] Whether to remove the pattern from the returned data.
|
|
585
|
+
# @returns [String | Nil] The contents of the stream up until the pattern, or nil if the pattern was not found.
|
|
586
|
+
#
|
|
587
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:212
|
|
588
|
+
def read_until(pattern, offset = T.unsafe(nil), limit: T.unsafe(nil), chomp: T.unsafe(nil)); end
|
|
589
|
+
|
|
590
|
+
# Whether there is a chance that a read operation will succeed or not.
|
|
591
|
+
# @returns [Boolean] If the stream is readable, i.e. a `read` operation has a chance of success.
|
|
592
|
+
#
|
|
593
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:382
|
|
594
|
+
def readable?; end
|
|
595
|
+
|
|
596
|
+
# This is a compatibility shim for existing code that uses `readpartial`.
|
|
597
|
+
# @parameter size [Integer | Nil] The number of bytes to read.
|
|
598
|
+
# @parameter buffer [String | Nil] An optional buffer to fill with data instead of allocating a new string.
|
|
599
|
+
# @returns [String] The data read from the stream.
|
|
600
|
+
#
|
|
601
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:170
|
|
602
|
+
def readpartial(size = T.unsafe(nil), buffer = T.unsafe(nil)); end
|
|
603
|
+
|
|
604
|
+
private
|
|
605
|
+
|
|
606
|
+
# Consumes at most `size` bytes from the buffer.
|
|
607
|
+
# @parameter size [Integer | Nil] The amount of data to consume. If nil, consume entire buffer.
|
|
608
|
+
# @parameter buffer [String | Nil] An optional buffer to fill with data instead of allocating a new string.
|
|
609
|
+
# @returns [String | Nil] The consumed data, or nil if no data available.
|
|
610
|
+
#
|
|
611
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:443
|
|
612
|
+
def consume_read_buffer(size = T.unsafe(nil), buffer = T.unsafe(nil)); end
|
|
613
|
+
|
|
614
|
+
# Fills the buffer from the underlying stream.
|
|
615
|
+
#
|
|
616
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:410
|
|
617
|
+
def fill_read_buffer(size = T.unsafe(nil)); end
|
|
618
|
+
|
|
619
|
+
# Find the index of a pattern in the read buffer, reading more data if needed.
|
|
620
|
+
# @parameter pattern [String] The pattern to search for.
|
|
621
|
+
# @parameter offset [Integer] The offset to start searching from.
|
|
622
|
+
# @parameter limit [Integer | Nil] The maximum number of bytes to read while searching.
|
|
623
|
+
# @returns [Integer | Nil] The index of the pattern, or nil if not found.
|
|
624
|
+
#
|
|
625
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:179
|
|
626
|
+
def index_of(pattern, offset, limit, discard = T.unsafe(nil)); end
|
|
627
|
+
|
|
628
|
+
# Attempts to read data from the underlying stream without blocking.
|
|
629
|
+
# Implementations may override this method when non-blocking reads are supported.
|
|
630
|
+
#
|
|
631
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:405
|
|
632
|
+
def sysread_nonblock(size, buffer); end
|
|
633
|
+
|
|
634
|
+
class << self
|
|
635
|
+
# Check if a method is async-safe.
|
|
636
|
+
#
|
|
637
|
+
# @parameter method [Symbol] The method name to check.
|
|
638
|
+
# @returns [Symbol | Boolean] The concurrency guard for the given method.
|
|
639
|
+
#
|
|
640
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:50
|
|
641
|
+
def async_safe?(method); end
|
|
642
|
+
end
|
|
643
|
+
end
|
|
644
|
+
|
|
645
|
+
# pkg:gem/io-stream#lib/io/stream/readable.rb:28
|
|
646
|
+
IO::Stream::Readable::ASYNC_SAFE = T.let(T.unsafe(nil), Hash)
|
|
647
|
+
|
|
648
|
+
# A specialized string buffer for binary data with automatic encoding handling.
|
|
649
|
+
#
|
|
650
|
+
# pkg:gem/io-stream#lib/io/stream/string_buffer.rb:8
|
|
651
|
+
class IO::Stream::StringBuffer < ::String
|
|
652
|
+
# Initialize a new string buffer with binary encoding.
|
|
653
|
+
#
|
|
654
|
+
# pkg:gem/io-stream#lib/io/stream/string_buffer.rb:12
|
|
655
|
+
def initialize; end
|
|
656
|
+
|
|
657
|
+
# Append a string to the buffer, converting to binary encoding if necessary.
|
|
658
|
+
# @parameter string [String] The string to append.
|
|
659
|
+
# @returns [StringBuffer] Self for method chaining.
|
|
660
|
+
#
|
|
661
|
+
# pkg:gem/io-stream#lib/io/stream/string_buffer.rb:21
|
|
662
|
+
def <<(string); end
|
|
663
|
+
|
|
664
|
+
# pkg:gem/io-stream#lib/io/stream/string_buffer.rb:31
|
|
665
|
+
def concat(string); end
|
|
666
|
+
end
|
|
667
|
+
|
|
668
|
+
# pkg:gem/io-stream#lib/io/stream/string_buffer.rb:9
|
|
669
|
+
IO::Stream::StringBuffer::BINARY = T.let(T.unsafe(nil), Encoding)
|
|
670
|
+
|
|
671
|
+
# pkg:gem/io-stream#lib/io/stream/version.rb:7
|
|
672
|
+
IO::Stream::VERSION = T.let(T.unsafe(nil), String)
|
|
673
|
+
|
|
674
|
+
# A module providing writable stream functionality.
|
|
675
|
+
#
|
|
676
|
+
# You must implement the `syswrite` method to write data to the underlying IO.
|
|
677
|
+
#
|
|
678
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:15
|
|
679
|
+
module IO::Stream::Writable
|
|
680
|
+
# Initialize writable stream functionality.
|
|
681
|
+
# @parameter minimum_write_size [Integer] The minimum buffer size before flushing.
|
|
682
|
+
#
|
|
683
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:32
|
|
684
|
+
def initialize(minimum_write_size: T.unsafe(nil), **, &block); end
|
|
685
|
+
|
|
686
|
+
# Appends `string` to the buffer and returns self for method chaining.
|
|
687
|
+
# @parameter string [String] the string to write to the stream.
|
|
688
|
+
#
|
|
689
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:71
|
|
690
|
+
def <<(string); end
|
|
691
|
+
|
|
692
|
+
# Close the write end of the stream by flushing any remaining data.
|
|
693
|
+
#
|
|
694
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:93
|
|
695
|
+
def close_write; end
|
|
696
|
+
|
|
697
|
+
# Flushes buffered data to the stream.
|
|
698
|
+
#
|
|
699
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:43
|
|
700
|
+
def flush; end
|
|
701
|
+
|
|
702
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:40
|
|
703
|
+
def minimum_write_size; end
|
|
704
|
+
|
|
705
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:40
|
|
706
|
+
def minimum_write_size=(_arg0); end
|
|
707
|
+
|
|
708
|
+
# Write arguments to the stream followed by a separator and flush immediately.
|
|
709
|
+
# @parameter arguments [Array] The arguments to write to the stream.
|
|
710
|
+
# @parameter separator [String] The separator to append after each argument.
|
|
711
|
+
#
|
|
712
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:80
|
|
713
|
+
def puts(*arguments, separator: T.unsafe(nil)); end
|
|
714
|
+
|
|
715
|
+
# Writes `string` to the buffer. When the buffer is full or #sync is true the
|
|
716
|
+
# buffer is flushed to the underlying `io`.
|
|
717
|
+
# @parameter string [String] the string to write to the buffer.
|
|
718
|
+
# @returns [Integer] the number of bytes appended to the buffer.
|
|
719
|
+
#
|
|
720
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:55
|
|
721
|
+
def write(string, flush: T.unsafe(nil)); end
|
|
722
|
+
|
|
723
|
+
private
|
|
724
|
+
|
|
725
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:97
|
|
726
|
+
def drain(buffer); end
|
|
727
|
+
|
|
728
|
+
class << self
|
|
729
|
+
# Check if a method is async-safe.
|
|
730
|
+
#
|
|
731
|
+
# @parameter method [Symbol] The method name to check.
|
|
732
|
+
# @returns [Symbol | Boolean] The concurrency guard for the given method.
|
|
733
|
+
#
|
|
734
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:26
|
|
735
|
+
def async_safe?(method); end
|
|
736
|
+
end
|
|
737
|
+
end
|
|
738
|
+
|
|
739
|
+
# pkg:gem/io-stream#lib/io/stream/writable.rb:16
|
|
740
|
+
IO::Stream::Writable::ASYNC_SAFE = T.let(T.unsafe(nil), Hash)
|
|
741
|
+
|
|
742
|
+
IO::WRITABLE = T.let(T.unsafe(nil), Integer)
|
|
743
|
+
|
|
744
|
+
# SSL socket extensions for stream compatibility.
|
|
745
|
+
#
|
|
746
|
+
# pkg:gem/io-stream#lib/io/stream/shim/readable.rb:53
|
|
747
|
+
class OpenSSL::SSL::SSLSocket
|
|
748
|
+
include ::Enumerable
|
|
749
|
+
|
|
750
|
+
# Set the buffered state of the SSL socket.
|
|
751
|
+
# @parameter value [Boolean] True to enable buffering, false to disable.
|
|
752
|
+
#
|
|
753
|
+
# pkg:gem/io-stream#lib/io/stream/openssl.rb:25
|
|
754
|
+
def buffered=(value); end
|
|
755
|
+
|
|
756
|
+
# Check if the SSL socket is buffered.
|
|
757
|
+
# @returns [Boolean] True if the SSL socket is buffered.
|
|
758
|
+
#
|
|
759
|
+
# pkg:gem/io-stream#lib/io/stream/openssl.rb:17
|
|
760
|
+
def buffered?; end
|
|
761
|
+
|
|
762
|
+
# Check if the SSL socket is readable.
|
|
763
|
+
# @returns [Boolean] True if the SSL socket is readable.
|
|
764
|
+
#
|
|
765
|
+
# pkg:gem/io-stream#lib/io/stream/shim/readable.rb:57
|
|
766
|
+
def readable?; end
|
|
767
|
+
end
|
|
768
|
+
|
|
769
|
+
# StringIO extensions for buffering support.
|
|
770
|
+
#
|
|
771
|
+
# pkg:gem/io-stream#lib/io/stream/shim/buffered.rb:68
|
|
772
|
+
class StringIO
|
|
773
|
+
include ::Enumerable
|
|
774
|
+
|
|
775
|
+
# Set the buffered state of the StringIO.
|
|
776
|
+
# @parameter value [Boolean] True to enable buffering, false to disable.
|
|
777
|
+
#
|
|
778
|
+
# pkg:gem/io-stream#lib/io/stream/shim/buffered.rb:77
|
|
779
|
+
def buffered=(value); end
|
|
780
|
+
|
|
781
|
+
# Check if the StringIO is buffered.
|
|
782
|
+
# @returns [Boolean] True if the StringIO is buffered (not synchronized).
|
|
783
|
+
#
|
|
784
|
+
# pkg:gem/io-stream#lib/io/stream/shim/buffered.rb:71
|
|
785
|
+
def buffered?; end
|
|
786
|
+
|
|
787
|
+
# Check if the StringIO is readable.
|
|
788
|
+
# @returns [Boolean] True if the StringIO is readable (not at EOF).
|
|
789
|
+
#
|
|
790
|
+
# pkg:gem/io-stream#lib/io/stream/shim/readable.rb:45
|
|
791
|
+
def readable?; end
|
|
792
|
+
|
|
793
|
+
# Return the configured timeout for this in-memory stream.
|
|
794
|
+
# @returns [Numeric | Nil] The configured timeout, if any.
|
|
795
|
+
#
|
|
796
|
+
# pkg:gem/io-stream#lib/io/stream/shim/timeout.rb:12
|
|
797
|
+
def timeout; end
|
|
798
|
+
|
|
799
|
+
# Store timeout state for compatibility with IO-like timeout interfaces.
|
|
800
|
+
# @parameter duration [Numeric | Nil] The timeout to assign.
|
|
801
|
+
# @returns [Numeric | Nil] The assigned timeout.
|
|
802
|
+
#
|
|
803
|
+
# pkg:gem/io-stream#lib/io/stream/shim/timeout.rb:21
|
|
804
|
+
def timeout=(duration); end
|
|
805
|
+
end
|