Trait interoptopus_backend_csharp::InteropCSharp [−][src]
pub trait InteropCSharp {}Show methods
fn config(&self) -> &Config; fn library(&self) -> &Library; fn type_primitive_to_typename(&self, x: &PrimitiveType) -> String { ... } fn type_enum_to_typename(&self, x: &EnumType) -> String { ... } fn type_opaque_to_typename(&self, _: &OpaqueType) -> String { ... } fn type_composite_to_typename(&self, x: &CompositeType) -> String { ... } fn type_fnpointer_to_typename(&self, x: &FnPointerType) -> String { ... } fn type_to_typespecifier_in_field(
&self,
x: &CType,
_field: &Field,
_composite: &CompositeType
) -> String { ... } fn type_to_typespecifier_in_param(&self, x: &CType) -> String { ... } fn type_to_typespecifier_in_rval(&self, x: &CType) -> String { ... } fn constant_value_to_value(&self, value: &ConstantValue) -> String { ... } fn function_parameter_to_csharp_typename(
&self,
x: &Parameter,
_function: &Function
) -> String { ... } fn function_rval_to_csharp_typename(&self, function: &Function) -> String { ... } fn function_name_to_csharp_name(&self, function: &Function) -> String { ... } fn write_file_header_comments(
&self,
w: &mut IndentWriter<'_>
) -> Result<(), Error> { ... } fn write_imports(&self, w: &mut IndentWriter<'_>) -> Result<(), Error> { ... } fn write_native_lib_string(
&self,
w: &mut IndentWriter<'_>
) -> Result<(), Error> { ... } fn write_constants(&self, w: &mut IndentWriter<'_>) -> Result<(), Error> { ... } fn write_constant(
&self,
w: &mut IndentWriter<'_>,
constant: &Constant
) -> Result<(), Error> { ... } fn write_functions(&self, w: &mut IndentWriter<'_>) -> Result<(), Error> { ... } fn write_function(
&self,
w: &mut IndentWriter<'_>,
function: &Function
) -> Result<(), Error> { ... } fn write_documentation(
&self,
w: &mut IndentWriter<'_>,
documentation: &Documentation
) -> Result<(), Error> { ... } fn write_function_annotation(
&self,
w: &mut IndentWriter<'_>,
function: &Function
) -> Result<(), Error> { ... } fn write_function_declaration(
&self,
w: &mut IndentWriter<'_>,
function: &Function
) -> Result<(), Error> { ... } fn write_type_definitions(
&self,
w: &mut IndentWriter<'_>
) -> Result<(), Error> { ... } fn write_type_definition(
&self,
w: &mut IndentWriter<'_>,
the_type: &CType
) -> Result<(), Error> { ... } fn write_type_definition_fn_pointer(
&self,
w: &mut IndentWriter<'_>,
the_type: &FnPointerType
) -> Result<(), Error> { ... } fn write_type_definition_fn_pointer_annotation(
&self,
w: &mut IndentWriter<'_>,
_the_type: &FnPointerType
) -> Result<(), Error> { ... } fn write_type_definition_fn_pointer_body(
&self,
w: &mut IndentWriter<'_>,
the_type: &FnPointerType
) -> Result<(), Error> { ... } fn write_type_definition_enum(
&self,
w: &mut IndentWriter<'_>,
the_type: &EnumType
) -> Result<(), Error> { ... } fn write_type_definition_enum_variant(
&self,
w: &mut IndentWriter<'_>,
variant: &Variant,
_the_type: &EnumType
) -> Result<(), Error> { ... } fn write_type_definition_composite(
&self,
w: &mut IndentWriter<'_>,
the_type: &CompositeType
) -> Result<(), Error> { ... } fn write_type_definition_composite_annotation(
&self,
w: &mut IndentWriter<'_>,
_the_type: &CompositeType
) -> Result<(), Error> { ... } fn write_type_definition_composite_body(
&self,
w: &mut IndentWriter<'_>,
the_type: &CompositeType
) -> Result<(), Error> { ... } fn write_type_definition_composite_body_field(
&self,
w: &mut IndentWriter<'_>,
field: &Field,
the_type: &CompositeType
) -> Result<(), Error> { ... } fn write_namespace_context(
&self,
w: &mut IndentWriter<'_>,
f: impl FnOnce(&mut IndentWriter<'_>) -> Result<(), Error>
) -> Result<(), Error> { ... } fn write_class_context(
&self,
w: &mut IndentWriter<'_>,
f: impl FnOnce(&mut IndentWriter<'_>) -> Result<(), Error>
) -> Result<(), Error> { ... }
Required methods
Provided methods
fn type_primitive_to_typename(&self, x: &PrimitiveType) -> String
fn type_primitive_to_typename(&self, x: &PrimitiveType) -> String
Converts a primitive (Rust) type to a native C# type name, e.g., f32
to float
.
fn type_enum_to_typename(&self, x: &EnumType) -> String
fn type_enum_to_typename(&self, x: &EnumType) -> String
Converts a Rust enum name such as Error
to a C# enum name Error
.
fn type_opaque_to_typename(&self, _: &OpaqueType) -> String
fn type_opaque_to_typename(&self, _: &OpaqueType) -> String
TODO Converts an opaque Rust struct Context
to a C# struct ``.
fn type_composite_to_typename(&self, x: &CompositeType) -> String
fn type_composite_to_typename(&self, x: &CompositeType) -> String
Converts an Rust struct name Vec2
to a C# struct name Vec2
.
fn type_fnpointer_to_typename(&self, x: &FnPointerType) -> String
fn type_fnpointer_to_typename(&self, x: &FnPointerType) -> String
Converts an Rust fn()
to a C# delegate name such as InteropDelegate
.
fn type_to_typespecifier_in_field(
&self,
x: &CType,
_field: &Field,
_composite: &CompositeType
) -> String
fn type_to_typespecifier_in_field(
&self,
x: &CType,
_field: &Field,
_composite: &CompositeType
) -> String
Converts the u32
part in a Rust field x: u32
to a C# equivalent. Might convert pointers to IntPtr
.
fn type_to_typespecifier_in_param(&self, x: &CType) -> String
fn type_to_typespecifier_in_param(&self, x: &CType) -> String
Converts the u32
part in a Rust paramter x: u32
to a C# equivalent. Might convert pointers to out X
or ref X
.
fn type_to_typespecifier_in_rval(&self, x: &CType) -> String
fn constant_value_to_value(&self, value: &ConstantValue) -> String
fn function_parameter_to_csharp_typename(
&self,
x: &Parameter,
_function: &Function
) -> String
fn function_rval_to_csharp_typename(&self, function: &Function) -> String
fn function_name_to_csharp_name(&self, function: &Function) -> String
fn write_file_header_comments(
&self,
w: &mut IndentWriter<'_>
) -> Result<(), Error>
fn write_imports(&self, w: &mut IndentWriter<'_>) -> Result<(), Error>
fn write_native_lib_string(&self, w: &mut IndentWriter<'_>) -> Result<(), Error>
fn write_constants(&self, w: &mut IndentWriter<'_>) -> Result<(), Error>
fn write_constant(
&self,
w: &mut IndentWriter<'_>,
constant: &Constant
) -> Result<(), Error>
fn write_functions(&self, w: &mut IndentWriter<'_>) -> Result<(), Error>
fn write_function(
&self,
w: &mut IndentWriter<'_>,
function: &Function
) -> Result<(), Error>
fn write_documentation(
&self,
w: &mut IndentWriter<'_>,
documentation: &Documentation
) -> Result<(), Error>
fn write_function_annotation(
&self,
w: &mut IndentWriter<'_>,
function: &Function
) -> Result<(), Error>
fn write_function_declaration(
&self,
w: &mut IndentWriter<'_>,
function: &Function
) -> Result<(), Error>
fn write_type_definitions(&self, w: &mut IndentWriter<'_>) -> Result<(), Error>
fn write_type_definition(
&self,
w: &mut IndentWriter<'_>,
the_type: &CType
) -> Result<(), Error>
fn write_type_definition_fn_pointer(
&self,
w: &mut IndentWriter<'_>,
the_type: &FnPointerType
) -> Result<(), Error>
fn write_type_definition_fn_pointer_annotation(
&self,
w: &mut IndentWriter<'_>,
_the_type: &FnPointerType
) -> Result<(), Error>
fn write_type_definition_fn_pointer_body(
&self,
w: &mut IndentWriter<'_>,
the_type: &FnPointerType
) -> Result<(), Error>
fn write_type_definition_enum(
&self,
w: &mut IndentWriter<'_>,
the_type: &EnumType
) -> Result<(), Error>
fn write_type_definition_enum_variant(
&self,
w: &mut IndentWriter<'_>,
variant: &Variant,
_the_type: &EnumType
) -> Result<(), Error>
fn write_type_definition_composite(
&self,
w: &mut IndentWriter<'_>,
the_type: &CompositeType
) -> Result<(), Error>
fn write_type_definition_composite_annotation(
&self,
w: &mut IndentWriter<'_>,
_the_type: &CompositeType
) -> Result<(), Error>
fn write_type_definition_composite_body(
&self,
w: &mut IndentWriter<'_>,
the_type: &CompositeType
) -> Result<(), Error>
fn write_type_definition_composite_body_field(
&self,
w: &mut IndentWriter<'_>,
field: &Field,
the_type: &CompositeType
) -> Result<(), Error>
fn write_namespace_context(
&self,
w: &mut IndentWriter<'_>,
f: impl FnOnce(&mut IndentWriter<'_>) -> Result<(), Error>
) -> Result<(), Error>
fn write_class_context(
&self,
w: &mut IndentWriter<'_>,
f: impl FnOnce(&mut IndentWriter<'_>) -> Result<(), Error>
) -> Result<(), Error>