Skip to main content

ExecutionOptions

Struct ExecutionOptions 

Source
pub struct ExecutionOptions { /* private fields */ }
Expand description

Operation policy with explicit tolerance, precision, and cancellation.

Deliberately not Copy: it carries a shared CancellationToken, and an implicitly copied cancellation handle is a footgun. Callers clone when they mean to share the token and construct fresh options when they do not.

Implementations§

Source§

impl ExecutionOptions

Source

pub const fn new(tolerance: Tolerance) -> Self

Start from the required model-aware tolerance.

Source

pub fn with_tolerance(self, tolerance: Tolerance) -> Self

Replace the tolerance while preserving every other execution policy.

Compilers use this when evaluating geometry in a transformed local coordinate system. Cloning first keeps cancellation, budgets, determinism, residency, and provider preferences intact.

Source

pub fn with_cancellation(self, token: CancellationToken) -> Self

Attach a cooperative cancellation token.

Absent a token, an operation runs to completion; there is no ambient cancellation source. Providers declare how finely they poll via crate::CancellationGranularity, so a caller can see the real latency.

Source

pub fn cancellation(&self) -> Option<&CancellationToken>

The attached cancellation token, if any.

Source

pub fn check_cancelled(&self) -> GeomResult<()>

Err(GeomError::Cancelled) if a token is attached and cancelled.

The call providers make at each poll point: options.check_cancelled()?. Cheap (one relaxed load) and a no-op when no token is attached.

Source

pub fn with_precision(self, precision: Precision) -> Self

Set required precision.

Source

pub fn with_determinism(self, value: Determinism) -> Self

Set determinism requirement.

Source

pub fn with_parallelism(self, value: Parallelism) -> Option<Self>

Set scheduling preference. Returns None for zero explicit threads.

Source

pub fn with_device(self, value: DevicePreference) -> Self

Set device preference.

Source

pub fn with_residency(self, value: DataResidency) -> Self

Declare where inputs live and where outputs are wanted.

Source

pub fn with_chord_error(self, value: Scalar) -> Option<Self>

Bound how far flattened curves may deviate from the exact curve.

Curved geometry that a provider approximates with straight chords (profile arcs, sweep directrices, curved B-rep faces) stays within this distance of the exact curve. Without it the chord budget is the linear tolerance, which is a coincidence tolerance and coarse for small radii: at Tolerance::MILLIMETRE a 5 mm arc gets four chords per half turn. Quantity take-off wants a tighter budget than display.

Returns None for a non-finite or non-positive value. A provider may still refuse a budget too fine to meet within its own work limits.

Source

pub fn chord_error(&self) -> Option<Scalar>

The explicit chord budget, if one was set.

None means the provider uses its default, the linear tolerance.

Source

pub fn with_memory_budget(self, bytes: usize) -> Self

Bound temporary allocation.

Source

pub fn tolerance(&self) -> Tolerance

Tolerance.

Source

pub fn precision(&self) -> Precision

Precision.

Source

pub fn determinism(&self) -> Determinism

Determinism requirement.

Source

pub fn parallelism(&self) -> Parallelism

Scheduling preference.

Source

pub fn device(&self) -> DevicePreference

Device preference.

Source

pub fn memory_budget_bytes(&self) -> Option<usize>

Optional temporary-memory budget.

Source

pub fn residency(&self) -> DataResidency

Where inputs live and where outputs are wanted.

Source

pub fn charge_scratch(&self, bytes: usize) -> GeomResult<()>

Charge bytes of scratch against the budget before allocating it.

The budget is only real if something checks it, so this is the single enforcement point every hot path routes through. Backends must call it before the allocation, not after: reporting an overrun once the allocation already succeeded defeats the purpose of a budget.

Trait Implementations§

Source§

impl Clone for ExecutionOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExecutionOptions

Source§

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

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

impl PartialEq for ExecutionOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ExecutionOptions

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.