mono-rt 0.1.0

Dynamic bindings to the Mono runtime for process injection into Unity games and Mono-hosted applications on Windows
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::mono_handle;
use crate::{Result, api};

mono_handle!(MonoObject);

impl MonoObject {
    /// Unboxes this object and returns a raw pointer to its value-type data.
    ///
    /// # Errors
    ///
    /// Returns [`MonoError::Uninitialized`] if the Mono API has not been initialized.
    pub fn unbox(self) -> Result<*mut c_void> {
        Ok(api()?.object_unbox(self.as_ptr()))
    }
}