Sha256: daebcffc90bc42a8328d8a33f76fc188a3646e0766abe7a49a49245b711ac6d9

Contents?: true

Size: 1.87 KB

Versions: 20

Compression:

Stored size: 1.87 KB

Contents

%a{annotate:rdoc:skip}
class IO
  # <!--
  #   rdoc-file=ext/io/wait/wait.c
  #   - io.nread -> int
  # -->
  # Returns number of bytes that can be read without blocking. Returns zero if no
  # information available.
  #
  def nread: () -> Integer

  # <!--
  #   rdoc-file=ext/io/wait/wait.c
  #   - io.ready? -> true or false
  # -->
  # Returns `true` if input available without blocking, or `false`.
  #
  def ready?: () -> boolish

  # <!--
  #   rdoc-file=ext/io/wait/wait.c
  #   - io.wait(events, timeout) -> event mask or false.
  #   - io.wait(timeout = nil, mode = :read) -> event mask or false.
  # -->
  # Waits until the IO becomes ready for the specified events and returns the
  # subset of events that become ready, or `false` when times out.
  #
  # The events can be a bit mask of `IO::READABLE`, `IO::WRITABLE` or
  # `IO::PRIORITY`.
  #
  # Returns `true` immediately when buffered data is available.
  #
  # Optional parameter `mode` is one of `:read`, `:write`, or `:read_write`.
  #
  def wait: (Integer events, ?Numeric timeout) -> (self | bool | nil)
          | (?Numeric? timeout, *wait_mode mode) -> (self | bool | nil)

  type wait_mode = :read | :r | :readable | :write | :w | :writable | :read_write | :rw | :readable_writable

  # <!--
  #   rdoc-file=ext/io/wait/wait.c
  #   - io.wait_readable          -> true or false
  #   - io.wait_readable(timeout) -> true or false
  # -->
  # Waits until IO is readable and returns `true`, or `false` when times out.
  # Returns `true` immediately when buffered data is available.
  #
  def wait_readable: (?Numeric? timeout) -> (self | bool | nil)?

  # <!--
  #   rdoc-file=ext/io/wait/wait.c
  #   - io.wait_writable          -> true or false
  #   - io.wait_writable(timeout) -> true or false
  # -->
  # Waits until IO is writable and returns `true` or `false` when times out.
  #
  def wait_writable: (?Numeric? timeout) -> boolish
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/rbs-2.8.4/core/io/wait.rbs
rbs-3.0.0.dev.2 core/io/wait.rbs
rbs-2.8.4 core/io/wait.rbs
rbs-2.8.3 core/io/wait.rbs
rbs-3.0.0.dev.1 core/io/wait.rbs
rbs-2.8.2 core/io/wait.rbs
rbs-2.8.1 core/io/wait.rbs
rbs-2.8.0 core/io/wait.rbs
rbs-2.8.0.pre.1 core/io/wait.rbs
rbs-2.7.0 core/io/wait.rbs
rbs-2.7.0.pre.3 core/io/wait.rbs
rbs-2.7.0.pre.2 core/io/wait.rbs
rbs-2.7.0.pre.1 core/io/wait.rbs
rbs-2.6.0 core/io/wait.rbs
rbs-2.5.1 core/io/wait.rbs
rbs-2.5.0 core/io/wait.rbs
rbs-2.4.0 core/io/wait.rbs
rbs-2.3.2 core/io/wait.rbs
rbs-2.3.1 core/io/wait.rbs
rbs-2.3.0 core/io/wait.rbs