[−][src]Struct csharpbindgen::Builder
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 Sync for Builder
impl Unpin for Builder
impl Send for Builder
impl UnwindSafe for Builder
impl RefUnwindSafe for Builder
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,