[][src]Struct csharpbindgen::Builder

pub struct Builder { /* fields omitted */ }

A builder pattern for the Rust-to-C# conversion process.

Methods

impl Builder[src]

pub fn new<T: AsRef<str>>(dll_name: T, rust_code: String) -> Self[src]

Creates a new instance with the following arguments:

  • dll_name is the name of the DLL that the C# DllImport attribute will be bound to for all exported functions.

  • rust_code is the source Rust code to convert into C#.

pub fn class_name<T: AsRef<str>>(self, class_name: T) -> Self[src]

Sets the name of the C# class that will contain all exported functions. If never called, the C# class will be called RustExports.

pub fn ignore(self, ignores: &[&str]) -> Self[src]

Specifies a list of Rust identifier patterns to be ignored (i.e., not exported to C#).

The pattern syntax is currently very simple: if it ends with a *, it matches any Rust identifier that starts with the part of the pattern before the * (e.g., Boop* matches BoopJones and BoopFoo). Otherwise, it represents an exact match to a Rust identifier.

pub fn access<T: AsRef<str>>(self, symbol_name: T, access: CSAccess) -> Self[src]

Specifies that the given Rust identifier should be exported to C# with the given C# access modifier. By default, all exports are given the internal access modifier.

pub fn generate(self) -> Result<String, Error>[src]

Performs the conversion of source Rust code to C#.

Auto Trait Implementations

impl Unpin for Builder

impl Sync for Builder

impl Send for Builder

impl RefUnwindSafe for Builder

impl UnwindSafe for Builder

Blanket Implementations

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.

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

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

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