pub struct Runtime { /* private fields */ }Expand description
Coordinates Excel linking, registration, and orderly XLL close.
A runtime is process-local application state, not a callback context. Its transition methods must be called through genuine Excel lifecycle thunks.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn production() -> Self
pub fn production() -> Self
Creates the process-local runtime using the production Excel12v backend.
The backend remains unlinked until Self::initialize runs from a
genuine lifecycle callback.
Sourcepub fn set_excel12_entry_point(&self, callback: Excel12EntryPtFn)
pub fn set_excel12_entry_point(&self, callback: Excel12EntryPtFn)
Installs Excel’s Excel12v callback entry point in the SDK backend.
Generated lifecycle thunks call this before initialization; passing an entry point does not itself link the backend or make arbitrary calls legal.
Sourcepub fn phase(&self) -> RuntimePhase
pub fn phase(&self) -> RuntimePhase
Returns the current lifecycle phase.
Sourcepub fn diagnostics(&self) -> RuntimeDiagnostics
pub fn diagnostics(&self) -> RuntimeDiagnostics
Returns a copied snapshot of process-local lifecycle counters.
Sourcepub fn registration_ids(&self) -> Vec<f64>
pub fn registration_ids(&self) -> Vec<f64>
Returns worksheet-function registration identifiers currently tracked.
The IDs are meaningful only while the current runtime generation remains active and must not be used to issue raw unregister calls directly.
Sourcepub fn initialize(
&self,
add_in: &AddInDescriptor,
) -> Result<LifecycleOutcome, LifecycleError>
pub fn initialize( &self, add_in: &AddInDescriptor, ) -> Result<LifecycleOutcome, LifecycleError>
Links Excel, installs a fresh generation, and registers add_in.
Call only from an Excel-issued open/lifecycle callback. On partial
registration failure this performs bounded rollback; a rollback failure
leaves RuntimePhase::CleanupRequired so Self::close can retry.
Sourcepub fn close(&self) -> Result<LifecycleOutcome, LifecycleError>
pub fn close(&self) -> Result<LifecycleOutcome, LifecycleError>
Retires dispatcher and async generations, unregisters, then unlinks Excel.
This must run from a genuine lifecycle callback. Failed unregister calls
retain conservative cleanup state and return LifecycleError::CloseFailed;
retrying close never reactivates old generations.