pub struct ModuleRecord { /* private fields */ }Expand description
One loaded module.
Held on the GC heap because its cells and namespace are GC values. The whole record is
behind interior mutability the same way a Cell is: linking writes into it while
other modules already hold references to it.
Implementations§
Source§impl ModuleRecord
impl ModuleRecord
Sourcepub fn new(inner: ModuleInner) -> ModuleRecord
pub fn new(inner: ModuleInner) -> ModuleRecord
Build a record around inner.
Sourcepub fn with<R>(&self, f: impl FnOnce(&ModuleInner) -> R) -> R
pub fn with<R>(&self, f: impl FnOnce(&ModuleInner) -> R) -> R
Run f with the record borrowed.
Sourcepub fn with_mut<R>(&self, f: impl FnOnce(&mut ModuleInner) -> R) -> R
pub fn with_mut<R>(&self, f: impl FnOnce(&mut ModuleInner) -> R) -> R
Run f with the record borrowed mutably.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ModuleRecord
impl !RefUnwindSafe for ModuleRecord
impl !Send for ModuleRecord
impl !Sync for ModuleRecord
impl !UnwindSafe for ModuleRecord
impl Forget for ModuleRecord
impl Move for ModuleRecord
impl Unpin for ModuleRecord
impl UnsafeUnpin for ModuleRecord
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