pub struct PreconditionOptions {
pub coerce_all: bool,
pub coerce_params: HashSet<String>,
pub explicit: HashMap<String, ExplicitChecks>,
pub unchecked: HashSet<String>,
pub formals: Formals,
}Expand description
Per-function knobs that influence precondition codegen.
Coercion preserves numeric input types, extends bool / Vec<bool>
checks to accept integers as well as logicals, and widens the native
i32 / Vec<i32> gates to whole-number doubles. Other types keep their checks.
Strict input conversion remains enforced in Rust, where range and precision
failures can carry contextual diagnostics.
Fields§
§coerce_all: boolcoerce knob is active for all parameters (coerce_all).
coerce_params: HashSet<String>R-normalized names of parameters with a per-param coerce attribute.
explicit: HashMap<String, ExplicitChecks>Checks the author named per parameter (inherits, not_inherits,
no_na), keyed by R-normalized parameter name.
unchecked: HashSet<String>R-normalized names of the parameters whose type-derived checks are
dropped (each one resolved by resolve_type_checks). Their
explicit checks are still emitted.
formals: FormalsThe R formal of each parameter (#1842): the name every check, every argument error and every map above uses. Without a declared formal, the Rust name without leading underscores.
Implementations§
Source§impl PreconditionOptions
impl PreconditionOptions
Sourcefn is_coerced(&self, r_name: &str) -> bool
fn is_coerced(&self, r_name: &str) -> bool
Returns true if the parameter r_name is coerced (function-wide or
per-param).
Trait Implementations§
Source§impl Clone for PreconditionOptions
impl Clone for PreconditionOptions
Auto Trait Implementations§
impl !Send for PreconditionOptions
impl !Sync for PreconditionOptions
impl Freeze for PreconditionOptions
impl RefUnwindSafe for PreconditionOptions
impl Unpin for PreconditionOptions
impl UnsafeUnpin for PreconditionOptions
impl UnwindSafe for PreconditionOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
core_io_internals)[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
ptr_alignment_type)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
sized_type_properties)[Self]. Read moreLayout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 200 bytes