specler 0.21.0

A simple way to write specifications on values
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::marker::PhantomData;
use crate::core::spec::Spec;

/// A marker struct to indicate that a validation is required
pub struct Require<T: Clone> {
    phantom_data: PhantomData<T>
}

impl <T: Clone> Require<T> {
    /// Starts the creation of a new validation spec
    pub fn to() -> Spec<T> {
        Spec::<T>::new()
    }
}