Skip to main content

ThreadSafeContext

Struct ThreadSafeContext 

Source
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<'_>

Source

pub fn drain_dispatcher(&self) -> DispatchDrainReport

Drains one bounded batch containing only thread-safe-compatible or pure work.

Source§

impl<'call> ThreadSafeContext<'call>

Source

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.

Source

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>

Source

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.

Source

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>

Source

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.

Trait Implementations§

Source§

impl<'call> Debug for ThreadSafeContext<'call>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'call> !RefUnwindSafe for ThreadSafeContext<'call>

§

impl<'call> !UnwindSafe for ThreadSafeContext<'call>

§

impl<'call> Freeze for ThreadSafeContext<'call>

§

impl<'call> Send for ThreadSafeContext<'call>

§

impl<'call> Sync for ThreadSafeContext<'call>

§

impl<'call> Unpin for ThreadSafeContext<'call>

§

impl<'call> UnsafeUnpin for ThreadSafeContext<'call>

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.