rustbasic-core 0.1.26

Core framework logic for RustBasic - A modern web framework for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::validator::Validate;
use std::collections::HashMap;

pub struct Validator;

impl Validator {
    /// Validate a struct that implements our custom Validate trait, returning a Map of field errors
    pub fn validate<T: Validate>(data: &T) -> Result<(), HashMap<String, String>> {
        data.validate()
    }
}