Skip to main content

IntoConditionResult

Trait IntoConditionResult 

Source
pub trait IntoConditionResult: Send + 'static {
    // Required method
    fn into_condition_result(self) -> Result<bool, Error>;
}
Expand description

What a condition closure may return: bool for a predicate that cannot fail, or Result<bool> for one that can.

This is what keeps a fallible predicate from being a breaking change to every builder that takes one: both forms satisfy the same bound, so |v| v["urgent"] == true and |v| Ok(serde_json::from_value::<Order>(v.clone())?.urgent) are both accepted where a condition is wanted.

Required Methods§

Source

fn into_condition_result(self) -> Result<bool, Error>

The verdict, or the reason there isn’t one.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl IntoConditionResult for Result<bool, Error>

Source§

impl IntoConditionResult for bool

Implementors§