pub struct ThreadSafeContext<'call> { /* private fields */ }Expand description
Capability token for a genuine multi-thread-safe worksheet callback.
Only calls explicitly documented as thread-safe may use this context.
Implementations§
Source§impl ThreadSafeContext<'_>
impl ThreadSafeContext<'_>
Sourcepub fn drain_dispatcher(&self) -> DispatchDrainReport
pub fn drain_dispatcher(&self) -> DispatchDrainReport
Drains one bounded batch containing only thread-safe-compatible or pure work.
Source§impl<'call> ThreadSafeContext<'call>
impl<'call> ThreadSafeContext<'call>
Sourcepub fn active_sheet_id(&self) -> Result<u64, ExcelCallError>
pub fn active_sheet_id(&self) -> Result<u64, ExcelCallError>
Returns the internal ID of Excel’s active/front sheet.
This is deliberately not named “current”: the zero-argument
xlSheetId contract identifies the active/front sheet.
Sourcepub fn current_sheet_name(&self) -> Result<ExcelString, ExcelCallError>
pub fn current_sheet_name(&self) -> Result<ExcelString, ExcelCallError>
Returns the name of the current sheet, not the active sheet.
Source§impl<'call> ThreadSafeContext<'call>
impl<'call> ThreadSafeContext<'call>
Sourcepub fn is_cancellation_requested(&self) -> Result<bool, ExcelCallError>
pub fn is_cancellation_requested(&self) -> Result<bool, ExcelCallError>
Poll whether Excel has received a user cancellation/break request. This zero-argument form preserves a pending break request.
Sourcepub fn is_cancellation_requested_with(
&self,
mode: AbortCheckMode,
) -> Result<bool, ExcelCallError>
pub fn is_cancellation_requested_with( &self, mode: AbortCheckMode, ) -> Result<bool, ExcelCallError>
Poll cancellation while explicitly preserving or clearing a pending break.
Source§impl<'call> ThreadSafeContext<'call>
impl<'call> ThreadSafeContext<'call>
Sourcepub fn coerce(
&self,
source: &ExcelOwnedValue<'call>,
target: CoerceTarget,
) -> Result<ExcelOwnedValue<'call>, ExcelCallError>
pub fn coerce( &self, source: &ExcelOwnedValue<'call>, target: CoerceTarget, ) -> Result<ExcelOwnedValue<'call>, ExcelCallError>
Converts an Excel-owned callback result to a requested root type.
The source remains owned by the caller and is not consumed or
released by xlCoerce; the returned root has its own xlFree
obligation encoded in ExcelOwnedValue.