Skip to main content

Not

Struct Not 

Source
pub struct Not<S> { /* private fields */ }
Expand description

English:
Negation that evaluates its inner rule once, flips Ok(bool), and propagates Err unchanged.

日本語:
内側の規則を一度評価し、Ok(bool) を反転し、Err は変更せず伝播する否定です。

Implementations§

Source§

impl<S> Not<S>

Source

pub fn new(inner: S) -> Not<S>

English:
Wraps inner by value without evaluating or validating it.

日本語:
評価や検証をせず、inner を値として包みます。

Trait Implementations§

Source§

impl<T, S> Specification<T> for Not<S>
where S: Specification<T>, T: ?Sized,

Source§

type Error = <S as Specification<T>>::Error

English:
Evaluation failure, distinct from a successfully evaluated false result. Read more
Source§

fn is_satisfied_by( &self, candidate: &T, ) -> Result<bool, <Not<S> as Specification<T>>::Error>

English:
Returns whether candidate satisfies the rule or why evaluation failed. The candidate remains borrowed; side effects and panic conditions depend on the rule. Read more
Source§

fn and<S>(self, other: S) -> And<Self, S>
where S: Specification<T, Error = Self::Error>,

English:
Consumes both rules to form And, evaluating other only if this rule returns Ok(true). Both must share an error type. Construction evaluates neither rule. Read more
Source§

fn or<S>(self, other: S) -> Or<Self, S>
where S: Specification<T, Error = Self::Error>,

English:
Consumes both rules to form Or, evaluating other only if this rule returns Ok(false). An error from this rule is returned without consulting other. Read more
Source§

fn not(self) -> Not<Self>

English:
Consumes this rule to form Not, which flips successful booleans and preserves errors. Read more

Auto Trait Implementations§

§

impl<S> Freeze for Not<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for Not<S>
where S: RefUnwindSafe,

§

impl<S> Send for Not<S>
where S: Send,

§

impl<S> Sync for Not<S>
where S: Sync,

§

impl<S> Unpin for Not<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for Not<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for Not<S>
where S: UnwindSafe,

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, 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.