pub mod types {
#[derive(Default, Debug)]
pub enum FormFieldInputType {
#[default]
Text,
Password,
Email,
}
#[derive(Debug)]
pub struct FormFieldConfig {
#[allow(unused)] input_name: &'static str,
#[allow(unused)] label: &'static str,
#[allow(unused)] input_type: FormFieldInputType,
#[allow(unused)] required: bool,
}
impl FormFieldConfig {
pub const fn new(
input_name: &'static str,
label: &'static str,
input_type: FormFieldInputType,
required: bool,
) -> Self {
Self {
input_name,
label,
input_type,
required,
}
}
}
}
pub mod traits {
use std::collections::HashMap;
pub trait Form {
fn validate(&self) -> Result<(), HashMap<&'static str, Vec<&'static str>>>;
}
}
pub mod exports {
pub use regex;
}
pub mod derive {
pub use anodyne_derive::Form;
}