pub struct Builder { /* private fields */ }
Expand description
A builder pattern for the Rust-to-C# conversion process.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new<T: AsRef<str>>(dll_name: T, rust_code: String) -> Self
pub fn new<T: AsRef<str>>(dll_name: T, rust_code: String) -> Self
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#.
Sourcepub fn class_name<T: AsRef<str>>(self, class_name: T) -> Self
pub fn class_name<T: AsRef<str>>(self, class_name: T) -> Self
Sets the name of the C# class that will contain all exported functions.
If never called, the C# class will be called RustExports
.
Sourcepub fn ignore(self, ignores: &[&str]) -> Self
pub fn ignore(self, ignores: &[&str]) -> Self
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.
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more