Skip to main content

Or

Struct Or 

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

English:
Disjunction that evaluates the right rule only after the left returns Ok(false). A left Ok(true) or error short-circuits; errors are not treated as a negative match.

日本語:
左が Ok(false) を返した場合のみ右を評価する論理和です。 左の Ok(true) やエラーで短絡し、エラーを不一致として扱いません。

Implementations§

Source§

impl<L, R> Or<L, R>

Source

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

English:
Owns the two operands in left-to-right evaluation order, without calling either rule.

日本語:
どちらも呼び出さず、左から右の評価順に二つの被演算子を所有します。

Trait Implementations§

Source§

impl<T, L, R> Specification<T> for Or<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, <Or<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 Or<L, R>
where L: Freeze, R: Freeze,

§

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

§

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

§

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

§

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

§

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

§

impl<L, R> UnwindSafe for Or<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.