Skip to main content

Runtime

Struct Runtime 

Source
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

Source

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.

Source

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.

Source

pub fn phase(&self) -> RuntimePhase

Returns the current lifecycle phase.

Source

pub fn diagnostics(&self) -> RuntimeDiagnostics

Returns a copied snapshot of process-local lifecycle counters.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for Runtime

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Runtime

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.