Skip to main content

ParamsCheck

Struct ParamsCheck 

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

The compiled schema of one action’s with: block.

Implementations§

Source§

impl ParamsCheck

Source

pub fn validate(&self, with: &Value) -> Vec<Violation>

Every way with fails the action’s schema, one violation per thing to fix.

An object with several unexpected keys gives one violation per key, so each can point at its own key. A value of the wrong type gives that violation alone: the rules about its value do not apply to it. Otherwise, of the rules one value breaks, those with an x-message say more than the generic ones and are the ones kept, and of two bounds on the same side only the tighter is.

Source

pub fn message( &self, action: ActionType, with: &Value, violation: &Violation, values: Values, ) -> String

The violation in words, for the author of the step holding with.

A violation about a value reads as the rule, then the value found when values allows it. Keys are always named: they are the definition’s, never a secret.

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.