pub struct SupportSwapper { /* private fields */ }Expand description
A Send + Sync handle for hot-swapping support modules from the
management adapter’s thread (the F-7b dev reload’s FFI leg).
Implementations§
Source§impl SupportSwapper
impl SupportSwapper
Sourcepub fn swap(
&self,
current: &SupportModuleRef,
bytecode: &[u8],
) -> Result<SupportModuleRef, RuntimeError>
pub fn swap( &self, current: &SupportModuleRef, bytecode: &[u8], ) -> Result<SupportModuleRef, RuntimeError>
Hot-swaps a support module to new bytes of the SAME module name: purges the generation the previous swap retained, then hot-loads the new bytes — the module-generation wall never bites because every swap purges before it loads. Only legal while every component using the module is stopped (the barrier’s order guarantees this); a purge refusal is the typed drain-failure signal.
A deferred-erlang:* refusal here does NOT delete the module the
way load_support_module’s initial-load cleanup does: at this
point the bad bytes are current and the previous bytes are
retained old — the caller’s rollback swap purges and reloads the
previous bytes, which a delete would sabotage.
§Errors
Returns typed failures for an unsafe purge, loader refusal, a
module absent immediately after load, or deferred erlang:*
imports.