Struct uniffi_bindgen::bindings::kotlin::gen_kotlin::KotlinCodeOracle
source · pub struct KotlinCodeOracle;
Implementations§
source§impl KotlinCodeOracle
impl KotlinCodeOracle
fn find(&self, type_: &Type) -> Box<dyn CodeType>
sourcefn class_name(&self, ci: &ComponentInterface, nm: &str) -> String
fn class_name(&self, ci: &ComponentInterface, nm: &str) -> String
Get the idiomatic Kotlin rendering of a class name (for enums, records, errors, etc).
fn convert_error_suffix(&self, nm: &str) -> String
sourcepub fn var_name_raw(&self, nm: &str) -> String
pub fn var_name_raw(&self, nm: &str) -> String
var_name
without the backticks. Useful for using in @Structure.FieldOrder
.
sourcefn enum_variant_name(&self, nm: &str) -> String
fn enum_variant_name(&self, nm: &str) -> String
Get the idiomatic Kotlin rendering of an individual enum variant.
sourcefn ffi_callback_name(&self, nm: &str) -> String
fn ffi_callback_name(&self, nm: &str) -> String
Get the idiomatic Kotlin rendering of an FFI callback function name
sourcefn ffi_struct_name(&self, nm: &str) -> String
fn ffi_struct_name(&self, nm: &str) -> String
Get the idiomatic Kotlin rendering of an FFI struct name
fn ffi_type_label_by_value(&self, ffi_type: &FfiType) -> String
sourcefn ffi_type_label_for_ffi_struct(&self, ffi_type: &FfiType) -> String
fn ffi_type_label_for_ffi_struct(&self, ffi_type: &FfiType) -> String
FFI type name to use inside structs
The main requirement here is that all types must have default values or else the struct won’t work in some JNA contexts.
sourcefn ffi_default_value(&self, ffi_type: &FfiType) -> String
fn ffi_default_value(&self, ffi_type: &FfiType) -> String
Default values for FFI
This is used to:
- Set a default return value for error results
- Set a default for structs, which JNA sometimes requires
fn ffi_type_label_by_reference(&self, ffi_type: &FfiType) -> String
fn ffi_type_label(&self, ffi_type: &FfiType) -> String
sourcefn object_names(
&self,
ci: &ComponentInterface,
obj: &Object
) -> (String, String)
fn object_names( &self, ci: &ComponentInterface, obj: &Object ) -> (String, String)
Get the name of the interface and class name for an object.
If we support callback interfaces, the interface name is the object name, and the class name is derived from that. Otherwise, the class name is the object name and the interface name is derived from that.
This split determines what types FfiConverter.lower()
inputs. If we support callback
interfaces, lower
must lower anything that implements the interface. If not, then lower
only lowers the concrete class.
Trait Implementations§
source§impl Clone for KotlinCodeOracle
impl Clone for KotlinCodeOracle
source§fn clone(&self) -> KotlinCodeOracle
fn clone(&self) -> KotlinCodeOracle
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more