Class: Rust::CWrapperGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/rust_require/c_wrapper_generator.rb,
lib/rust_require/c_wrapper_generator.rb

Overview

A Generator for Rust-to-C-wrappers Is initialized with a Json file containing relevant info about the rust file

Defined Under Namespace

Classes: WrapperFn

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ CWrapperGenerator

info file, already parsed with json



9
10
11
# File 'lib/rust_require/c_wrapper_generator.rb', line 9

def initialize(json)
  @json = json
end

Instance Method Details

#generate_wrapperObject

Generates a Rust-to-C code wrapper as rust code (String)



14
15
16
# File 'lib/rust_require/c_wrapper_generator.rb', line 14

def generate_wrapper
  generate_mod_wrapper(@json, '')
end