[][src]Trait refinement::Predicate

pub trait Predicate<T> {
    pub fn test(x: &T) -> bool;
}

A Predicate tests if a value satisfies a particular refinement type.

Example

use refinement::Predicate;

struct LessThanTenPredicate;

impl Predicate<i32> for LessThanTenPredicate {
    fn test(x: &i32) -> bool {
        *x < 10
    }
}

Required methods

pub fn test(x: &T) -> bool[src]

Loading content...

Implementors

Loading content...