pub struct MonoAssembly(/* private fields */);Expand description
An opaque handle to a Mono runtime object.
§Thread safety
This type is intentionally !Send + !Sync. Every thread that reads or writes
Mono objects must first be registered with the runtime via
crate::MonoThreadGuard::attach. Using a handle on an unregistered thread is
undefined behavior — Mono’s garbage collector and internal bookkeeping assume all
active threads are known to the runtime.
Handles are therefore bound to the thread on which they were obtained. The
compiler enforces this: a handle cannot be moved to another thread without
explicit unsafe code.
If you need to transfer a handle across thread boundaries and you can guarantee that both threads are attached to the runtime for the entire duration of use, you can opt in manually on your wrapper type:
ⓘ
struct MyComponent {
class: mono_rt::MonoClass,
}
// SAFETY: `class` is only accessed while the calling thread holds a
// `MonoThreadGuard`, ensuring it is registered with the Mono runtime.
unsafe impl Send for MyComponent {}
unsafe impl Sync for MyComponent {}Implementations§
Source§impl MonoAssembly
impl MonoAssembly
Source§impl MonoAssembly
impl MonoAssembly
Trait Implementations§
Source§impl Clone for MonoAssembly
impl Clone for MonoAssembly
Source§fn clone(&self) -> MonoAssembly
fn clone(&self) -> MonoAssembly
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MonoAssembly
impl Debug for MonoAssembly
impl Copy for MonoAssembly
Auto Trait Implementations§
impl Freeze for MonoAssembly
impl RefUnwindSafe for MonoAssembly
impl !Send for MonoAssembly
impl !Sync for MonoAssembly
impl Unpin for MonoAssembly
impl UnsafeUnpin for MonoAssembly
impl UnwindSafe for MonoAssembly
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