Struct csharp_binder::CSharpConfiguration [−][src]
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]
&mut self,
rust_type_name: &str,
csharp_namespace: Option<String>,
csharp_inside_type: Option<String>,
csharp_type_name: String
)
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
impl RefUnwindSafe for CSharpConfiguration
[src]
impl Send for CSharpConfiguration
[src]
impl Sync for CSharpConfiguration
[src]
impl Unpin for CSharpConfiguration
[src]
impl UnwindSafe for CSharpConfiguration
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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>,