Skip to main content

Validator

Trait Validator 

Source
pub trait Validator<const N: usize, R: ValidatorRet = (), F: KinScalar = f32>:
    Sized
    + Clone
    + Debug
    + Send
    + Sync
    + 'static {
    type Context<'ctx>: ValidatorContext;

    const VALIDATE_MOTION_IS_CONTINUOUS: bool = false;

    // Required methods
    fn validate<'ctx, E: Into<DekeError>, A: SRobotQLike<N, E, F>>(
        &self,
        q: A,
        ctx: &Self::Context<'ctx>,
    ) -> DekeResult<R>;
    fn validate_motion<'ctx>(
        &self,
        qs: &[SRobotQ<N, F>],
        ctx: &Self::Context<'ctx>,
    ) -> DekeResult<R>;

    // Provided method
    fn validate_batched<'ctx>(
        &self,
        qs: &[SRobotQ<N, F>],
        ctx: &Self::Context<'ctx>,
    ) -> BitVec { ... }
}

Provided Associated Constants§

Required Associated Types§

Required Methods§

Source

fn validate<'ctx, E: Into<DekeError>, A: SRobotQLike<N, E, F>>( &self, q: A, ctx: &Self::Context<'ctx>, ) -> DekeResult<R>

Source

fn validate_motion<'ctx>( &self, qs: &[SRobotQ<N, F>], ctx: &Self::Context<'ctx>, ) -> DekeResult<R>

Provided Methods§

Source

fn validate_batched<'ctx>( &self, qs: &[SRobotQ<N, F>], ctx: &Self::Context<'ctx>, ) -> BitVec

Validate a batch of configurations at once, returning a bitvec whose i-th bit is set iff qs[i] is invalid (rejected). The default runs Validator::validate per config; implementors with a batched fast path (SIMD, GPU) override it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Validator<1, (), f64> for DynamicJointValidator

f64 entry point — downcasts to f32 and dispatches to the f32 impl. DynamicJointValidator stores JointValidator<N, f32>, so f64 inputs are narrowed at the boundary; precision is governed by the f32 limits the validator was configured with.

Source§

type Context<'ctx> = ()

Source§

impl Validator<1> for DynamicJointValidator

Source§

type Context<'ctx> = ()

Source§

impl Validator<2, (), f64> for DynamicJointValidator

f64 entry point — downcasts to f32 and dispatches to the f32 impl. DynamicJointValidator stores JointValidator<N, f32>, so f64 inputs are narrowed at the boundary; precision is governed by the f32 limits the validator was configured with.

Source§

type Context<'ctx> = ()

Source§

impl Validator<2> for DynamicJointValidator

Source§

type Context<'ctx> = ()

Source§

impl Validator<3, (), f64> for DynamicJointValidator

f64 entry point — downcasts to f32 and dispatches to the f32 impl. DynamicJointValidator stores JointValidator<N, f32>, so f64 inputs are narrowed at the boundary; precision is governed by the f32 limits the validator was configured with.

Source§

type Context<'ctx> = ()

Source§

impl Validator<3> for DynamicJointValidator

Source§

type Context<'ctx> = ()

Source§

impl Validator<4, (), f64> for DynamicJointValidator

f64 entry point — downcasts to f32 and dispatches to the f32 impl. DynamicJointValidator stores JointValidator<N, f32>, so f64 inputs are narrowed at the boundary; precision is governed by the f32 limits the validator was configured with.

Source§

type Context<'ctx> = ()

Source§

impl Validator<4> for DynamicJointValidator

Source§

type Context<'ctx> = ()

Source§

impl Validator<5, (), f64> for DynamicJointValidator

f64 entry point — downcasts to f32 and dispatches to the f32 impl. DynamicJointValidator stores JointValidator<N, f32>, so f64 inputs are narrowed at the boundary; precision is governed by the f32 limits the validator was configured with.

Source§

type Context<'ctx> = ()

Source§

impl Validator<5> for DynamicJointValidator

Source§

type Context<'ctx> = ()

Source§

impl Validator<6, (), f64> for DynamicJointValidator

f64 entry point — downcasts to f32 and dispatches to the f32 impl. DynamicJointValidator stores JointValidator<N, f32>, so f64 inputs are narrowed at the boundary; precision is governed by the f32 limits the validator was configured with.

Source§

type Context<'ctx> = ()

Source§

impl Validator<6> for DynamicJointValidator

Source§

type Context<'ctx> = ()

Source§

impl Validator<7, (), f64> for DynamicJointValidator

f64 entry point — downcasts to f32 and dispatches to the f32 impl. DynamicJointValidator stores JointValidator<N, f32>, so f64 inputs are narrowed at the boundary; precision is governed by the f32 limits the validator was configured with.

Source§

type Context<'ctx> = ()

Source§

impl Validator<7> for DynamicJointValidator

Source§

type Context<'ctx> = ()

Source§

impl Validator<8, (), f64> for DynamicJointValidator

f64 entry point — downcasts to f32 and dispatches to the f32 impl. DynamicJointValidator stores JointValidator<N, f32>, so f64 inputs are narrowed at the boundary; precision is governed by the f32 limits the validator was configured with.

Source§

type Context<'ctx> = ()

Source§

impl Validator<8> for DynamicJointValidator

Source§

type Context<'ctx> = ()

Source§

impl<const N: usize, F: KinScalar, A> Validator<N, (), F> for ValidatorNot<A>
where A: Validator<N, (), F>,

Not is only meaningful for R = () (a pass/fail validator). For scalar-returning validators the inversion of the return value isn’t well-defined, so the impl is restricted to the unit case.

Source§

type Context<'ctx> = <A as Validator<N, (), F>>::Context<'ctx>

Source§

impl<const N: usize, F: KinScalar, R: ValidatorRet, A, B> Validator<N, R, F> for ValidatorAnd<A, B>
where A: Validator<N, R, F>, B: Validator<N, R, F>,

Blanket impls below cover every (N, R, F) triple that both member validators implement: a single generic impl over R and F (and N since validators are const-generic over DOF) means monomorphization fires the impl for every shared signature without manual enumeration.

Source§

type Context<'ctx> = (<A as Validator<N, R, F>>::Context<'ctx>, <B as Validator<N, R, F>>::Context<'ctx>)

Source§

impl<const N: usize, F: KinScalar, R: ValidatorRet, A, B> Validator<N, R, F> for ValidatorOr<A, B>
where A: Validator<N, R, F>, B: Validator<N, R, F>,

Source§

type Context<'ctx> = (<A as Validator<N, R, F>>::Context<'ctx>, <B as Validator<N, R, F>>::Context<'ctx>)

Source§

impl<const N: usize, F: KinScalar, R: ValidatorRet, V> Validator<N, R, F> for MaybeValidator<V>
where V: Validator<N, R, F>,

Source§

type Context<'ctx> = <V as Validator<N, R, F>>::Context<'ctx>

Source§

impl<const N: usize, F: KinScalar> Validator<N, (), F> for JointValidator<N, F>

Source§

type Context<'ctx> = ()

Source§

impl<const N: usize> Validator<N, (), f64> for JointValidator<N, f32>

Cross-precision entry point: f32-storage JointValidator accepting f64 inputs. The input is narrowed to f32 at the boundary so the same limits govern both precisions; comparison is done in storage precision.

Source§

type Context<'ctx> = ()

Source§

impl<const N: usize> Validator<N> for JointValidator<N, f64>

Cross-precision entry point: f64-storage JointValidator accepting f32 inputs. The f32 input is widened to f64 (lossless) before comparison.

Source§

type Context<'ctx> = ()