Skip to main content

Module borrowed

Module borrowed 

Source
Expand description

Callback-borrowed Excel values that cannot outlive their issuing callback. Read-only views over values supplied by Excel for one callback invocation.

The only entry point from the raw ABI is RawExcelValue::from_callback. It is unsafe because Rust cannot prove the validity or lifetime of the pointer-bearing members of an XLOPER12. Once that boundary has been audited by the callback thunk, decoding and observation are safe.

Callback views cannot be sent to another thread:

ⓘ
use excel_api::RawExcelValue;

fn require_send<T: Send>() {}
require_send::<RawExcelValue<'static>>();

Nor can their callback lifetime be extended:

ⓘ
use excel_api::{ExcelValueRef, RawExcelValue};

fn escape(raw: &RawExcelValue<'_>) -> ExcelValueRef<'static> {
    raw.decode().unwrap()
}

Structs§

ExcelArrayColumns
Iterator over an array’s columns.
ExcelArrayElements
Elements in one row or column of an Excel array.
ExcelArrayRows
Iterator over an array’s rows.
ExcelArrayView
A flat row-major xltypeMulti view.
ExcelMissing
Marker for an omitted function argument (xltypeMissing).
ExcelMultiReference
An explicit-sheet, one-or-more-area xltypeRef.
ExcelNil
Marker for an empty Excel value (xltypeNil).
ExcelReferenceArea
One rectangular area within a reference.
ExcelReferenceAreas
Iterator over the areas of an xltypeRef.
ExcelSingleReference
An inline, current-sheet xltypeSRef.
ExcelStr
Borrowed UTF-16 code units. No Unicode conversion is performed.
RawExcelValue
An XLOPER12 whose storage is owned by Excel for one callback invocation.

Enums§

DecodeError
Why a raw callback value could not be represented as a safe borrowed view.
ExcelReference
A reference-preserving callback value.
ExcelValueRef
A decoded, read-only Excel callback value.