Struct csharp_binder::CSharpConfiguration[][src]

pub struct CSharpConfiguration { /* fields omitted */ }

This struct holds the generic data used between multiple builds. Currently this only holds the type registry, but further features such as ignore patterns will likely be added here.

Implementations

impl CSharpConfiguration[src]

pub fn new(csharp_version: u8) -> Self[src]

Create a new C# configuration. Input parameter is the target version of C#, i.e. C# 7, 8, 9, etc.

pub fn add_known_type(
    &mut self,
    rust_type_name: &str,
    csharp_namespace: Option<String>,
    csharp_inside_type: Option<String>,
    csharp_type_name: String
)
[src]

Register a type the converter should know about.

Useful if you use a type on the Rust side that you know has a C# representation without first passing it through the C#builder. This function takes the Rust type name, along with an optional C# namespace, optional containing type, and the actual C# type name.

pub fn set_out_type(&mut self, rust_type_name: &str)[src]

Sets a rust type to represent an out parameter in C#.

This allows converting a parameter like foo: Out<u8> into out byte foo. Useful for following patterns such as: https://github.com/KodrAus/rust-csharp-ffi

pub fn set_generated_warning(&mut self, generated_warning: &str)[src]

By default we add a warning on top of each generated C# script, which defaults to // Automatically generated, do not edit!. This functions allows you to modify this warning. Can be multiline, and can be removed entirely by setting with an empty string.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.