#[doc(hidden)]pub struct EitherArmProbe<R>(PhantomData<fn() -> R>);Expand description
Reads TryFromSexp::CHARACTER_ONLY of the R arm of an Either<T, R>
choice parameter without requiring R: TryFromSexp.
#[miniextendr] emits, for each such arm (inside the generated C
wrapper),
{
use ::miniextendr_api::match_arg::EitherArmProbeFallback as _;
const _: () = ::core::assert!(
!::miniextendr_api::match_arg::EitherArmProbe::<R>::CHARACTER_ONLY,
"...",
);
}The path resolves to the inherent const below when R: TryFromSexp
holds. When it does not, path resolution rejects the inherent candidate
(its impl bound fails) and falls back to the const of
EitherArmProbeFallback, which is false. So the check adds no error
of its own for an R without a conversion: the decode’s single “R: TryFromSexp is not satisfied” is the whole diagnostic. Naming
<R as TryFromSexp>::CHARACTER_ONLY directly would report that missing
impl a second time.
Tuple Fields§
§0: PhantomData<fn() -> R>Implementations§
Source§impl<R: TryFromSexp> EitherArmProbe<R>
impl<R: TryFromSexp> EitherArmProbe<R>
Sourcepub const CHARACTER_ONLY: bool = R::CHARACTER_ONLY
pub const CHARACTER_ONLY: bool = R::CHARACTER_ONLY
Trait Implementations§
Source§impl<R> EitherArmProbeFallback for EitherArmProbe<R>
impl<R> EitherArmProbeFallback for EitherArmProbe<R>
Source§const CHARACTER_ONLY: bool = false
const CHARACTER_ONLY: bool = false
false.Layout§
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: 0 bytes