mono_rt/types/assembly.rs
1use super::{MonoImage, mono_handle};
2use crate::{Result, api};
3
4mono_handle!(MonoAssembly);
5
6impl MonoAssembly {
7 /// Returns the metadata image for this assembly.
8 ///
9 /// # Errors
10 ///
11 /// Returns [`crate::MonoError::Uninitialized`] if the Mono API has not been initialized.
12 pub fn image(self) -> Result<Option<MonoImage>> {
13 let ptr = api()?.assembly_get_image(self.as_ptr());
14 Ok(MonoImage::from_ptr(ptr))
15 }
16}