File: type.rbs

package info (click to toggle)
ruby-ffi 1.17.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,988 kB
  • sloc: ruby: 9,446; ansic: 7,713; xml: 151; sh: 51; makefile: 14
file content (39 lines) | stat: -rw-r--r-- 935 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module FFI
  class Type
    class Array = ArrayType
    class Function = FunctionType
    class Struct = StructByValue

    include AbstractMemory::_Size
    def initialize: (Integer | Type value) -> self
    def alignment: () -> Integer
    def inspect: ...

    class Builtin < Type
      def inspect: ...
    end

    class Mapped[X < _DataConverter[N, R, C], N, R, C]
      include _DataConverter[N, R, C]

      def initialize: (X converter) -> self
      def converter: () -> X
    end
  end

  class ArrayType
    def initialize: (Type component_type, Integer length) -> self
    def element_type: -> Type
    def length: -> Integer
  end

  class FunctionType < Type
    def initialize:
      (
        ffi_type return_type, Array[ffi_type] param_types,
        ?blocking: boolish, ?convention: Library::convention, ?enums: Enums
      ) -> self
    def param_types: () -> Array[Type]
    def return_type: () -> Type
  end
end