pub struct BoundAssembly {
pub assembly_name: &'static str,
pub assembly_path: &'static str,
pub thunks_name: &'static str,
pub coreclr_thunks: &'static [u8],
pub mono_thunks: &'static [u8],
pub function_count: usize,
/* private fields */
}Expand description
A .NET assembly bound with hao_runtime_macros::bind!.
Fields§
§assembly_name: &'static str§assembly_path: &'static str§thunks_name: &'static str§coreclr_thunks: &'static [u8]§mono_thunks: &'static [u8]§function_count: usizeImplementations§
Source§impl BoundAssembly
impl BoundAssembly
pub const fn new( assembly_name: &'static str, assembly_path: &'static str, thunks_name: &'static str, coreclr_thunks: &'static [u8], mono_thunks: &'static [u8], function_count: usize, ) -> Self
Sourcepub fn load(&self, runtime: &Runtime) -> Result<()>
pub fn load(&self, runtime: &Runtime) -> Result<()>
Loads the bound assembly and its thunks into runtime. Called on first use.
pub fn function(&self, runtime: &Runtime, index: usize) -> Result<*const c_void>
pub fn free(&self, runtime: &Runtime, handle: isize) -> Result<()>
Sourcepub fn take_string(
&self,
runtime: &Runtime,
handle: isize,
) -> Result<Option<String>>
pub fn take_string( &self, runtime: &Runtime, handle: isize, ) -> Result<Option<String>>
Reads and frees a handle to a System.String. 0 is null.
Sourcepub fn object_to_string(
&self,
runtime: &Runtime,
handle: isize,
) -> Result<String>
pub fn object_to_string( &self, runtime: &Runtime, handle: isize, ) -> Result<String>
ToString() of the object behind handle, without freeing it.
Sourcepub fn take_exception(&self, runtime: &Runtime, handle: isize) -> Error
pub fn take_exception(&self, runtime: &Runtime, handle: isize) -> Error
Turns a handle to a thrown exception into an Error::Managed, freeing it.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BoundAssembly
impl Forget for BoundAssembly
impl Move for BoundAssembly
impl RefUnwindSafe for BoundAssembly
impl Send for BoundAssembly
impl Sync for BoundAssembly
impl Unpin for BoundAssembly
impl UnsafeUnpin for BoundAssembly
impl UnwindSafe for BoundAssembly
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