pub struct PreconditionOptions {
pub coerce_all: bool,
pub coerce_params: HashSet<String>,
}Expand description
Per-function knobs that influence precondition codegen.
Currently only the coerce knob matters: #[miniextendr(coerce)] (or a
per-param #[miniextendr(coerce)]) changes the inbound conversion for an
integer-element vector to read via the native &[i32] slice and then
TryCoerce element-wise (see rust_conversion_builder.rs CoercionMapping::Vec).
That &[i32] read is INTSXP-only, so a coerced integer vector that would
otherwise accept whole-number REALSXP (RTypeCheck::VectorIntegerWide)
must instead get the strict is.integer gate (RTypeCheck::VectorIntegerStrict)
— otherwise a double passes the R precondition only to fail the Rust read
with “expected INTSXP, got REALSXP” (issue #616).
strict is intentionally not represented: inbound conversion is identical in
strict and default mode (TryFromSexp), so the R-side integer gate doesn’t
change. The precise strict checking happens on the Rust outbound side.
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.
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
Source§fn clone(&self) -> PreconditionOptions
fn clone(&self) -> PreconditionOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for PreconditionOptions
impl Default for PreconditionOptions
Source§fn default() -> PreconditionOptions
fn default() -> PreconditionOptions
Auto Trait Implementations§
impl Freeze for PreconditionOptions
impl RefUnwindSafe for PreconditionOptions
impl Send for PreconditionOptions
impl Sync 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: 56 bytes