Class: Rust::Types::F32

Inherits:
Type
  • Object
show all
Defined in:
lib/rust_require/types/primitives.rb

Instance Attribute Summary

Attributes inherited from Type

#rust_type

Instance Method Summary collapse

Methods inherited from Type

#c_input_type, #c_output_type, #ffi_input_type, #ffi_output_type, #initialize, #ruby_input_conversion, #ruby_output_conversion, rust_type, #rust_type_regex

Constructor Details

This class inherits a constructor from Rust::Types::Type

Instance Method Details

#c_input_conversion(name) ⇒ Object



50
# File 'lib/rust_require/types/primitives.rb', line 50

def c_input_conversion(name); "#{name} as f32"; end

#c_output_conversion(name) ⇒ Object



51
# File 'lib/rust_require/types/primitives.rb', line 51

def c_output_conversion(name); "#{name} as f64"; end

#c_typeObject

Ruby Floats are always f64



49
# File 'lib/rust_require/types/primitives.rb', line 49

def c_type; 'f64'; end

#ffi_typeObject



53
# File 'lib/rust_require/types/primitives.rb', line 53

def ffi_type; :double; end