trait CodeType: Debug {
// Required method
fn type_label(&self) -> String;
// Provided methods
fn canonical_name(&self) -> String { ... }
fn literal(&self, _literal: &Literal) -> String { ... }
fn ffi_converter_name(&self) -> String { ... }
fn lower(&self) -> String { ... }
fn write(&self) -> String { ... }
fn lift(&self) -> String { ... }
fn read(&self) -> String { ... }
fn imports(&self) -> Option<Vec<String>> { ... }
fn initialization_fn(&self) -> Option<String> { ... }
}
Expand description
A trait tor the implementation.
Required Methods§
sourcefn type_label(&self) -> String
fn type_label(&self) -> String
The language specific label used to reference this type. This will be used in method signatures and property declarations.
Provided Methods§
sourcefn canonical_name(&self) -> String
fn canonical_name(&self) -> String
A representation of this type label that can be used as part of another
identifier. e.g. read_foo()
, or FooInternals
.
This is especially useful when creating specialized objects or methods to deal with this type only.
fn literal(&self, _literal: &Literal) -> String
sourcefn ffi_converter_name(&self) -> String
fn ffi_converter_name(&self) -> String
Name of the FfiConverter
This is the object that contains the lower, write, lift, and read methods for this type.
sourcefn lower(&self) -> String
fn lower(&self) -> String
An expression for lowering a value into something we can pass over the FFI.
sourcefn lift(&self) -> String
fn lift(&self) -> String
An expression for lifting a value from something we received over the FFI.
sourcefn imports(&self) -> Option<Vec<String>>
fn imports(&self) -> Option<Vec<String>>
A list of imports that are needed if this type is in use. Classes are imported exactly once.
sourcefn initialization_fn(&self) -> Option<String>
fn initialization_fn(&self) -> Option<String>
Function to run at startup