module FFI
  class StructByReference[S < Struct[P, untyped], P < AbstractMemory]
    include DataConverter[P, S, untyped]
    attr_reader struct_class: Struct[P, untyped]

    def initialize: (S struct_class) -> void
    def from_native: (P value, untyped ctx) -> S
    def native_type: (?ffi_auto_type? type) -> Type
    def to_native: (S? value, untyped ctx) -> P
  end
end
