Skip to main content

And

Struct And 

Source
pub struct And<L, R> { /* private fields */ }
Expand description

English:
Conjunction that evaluates the right rule only after the left returns Ok(true). A left Ok(false) or error is returned immediately; a right result is forwarded unchanged.

日本語:
左が Ok(true) を返した場合のみ右を評価する論理積です。 左の Ok(false) やエラーは直ちに返し、右を評価した場合はその結果を変更せず返します。

Implementations§

Source§

impl<L, R> And<L, R>

Source

pub fn new(left: L, right: R) -> And<L, R>

English:
Stores left and right without evaluation; evaluation requires compatible specification impls.

日本語:
評価せずに left と right を保持します。評価には互換な仕様の実装が必要です。

Trait Implementations§

Source§

impl<T, L, R> Specification<T> for And<L, R>
where L: Specification<T>, R: Specification<T, Error = <L as Specification<T>>::Error>, T: ?Sized,

Source§

type Error = <L 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, <And<L, R> 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<L, R> Freeze for And<L, R>
where L: Freeze, R: Freeze,

§

impl<L, R> RefUnwindSafe for And<L, R>

§

impl<L, R> Send for And<L, R>
where L: Send, R: Send,

§

impl<L, R> Sync for And<L, R>
where L: Sync, R: Sync,

§

impl<L, R> Unpin for And<L, R>
where L: Unpin, R: Unpin,

§

impl<L, R> UnsafeUnpin for And<L, R>
where L: UnsafeUnpin, R: UnsafeUnpin,

§

impl<L, R> UnwindSafe for And<L, R>
where L: UnwindSafe, R: 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.