pub trait ToModel: HtmlControls + AdditionalValidation + ValidationModel {
fn key() -> String;
fn meta() -> Result<Meta, Box<dyn Error>>;
fn widgets() -> Result<HashMap<String, Widget>, Box<dyn Error>>;
fn get_hash(&self) -> Option<String>;
fn set_hash(&mut self, value: String);
fn self_to_json(&self) -> Result<Value, Box<dyn Error>>;
fn hash_to_id(hash: &str) -> Result<ObjectId, Box<dyn Error>> { ... }
fn id_to_hash(id: ObjectId) -> String { ... }
fn vitaminize(
project_name: &str,
unique_project_key: &str,
collection_name: &str,
client: &Client,
map_widgets: &mut HashMap<String, Widget>
) -> Result<(), Box<dyn Error>> { ... }
}
Expand description
Model options and widget map for Form.
Required Methods
Get map of widgets for model fields. Hint: <field name, Widget>
Provided Methods
fn id_to_hash(id: ObjectId) -> String
fn id_to_hash(id: ObjectId) -> String
Convert MongoDB ID to hash-line.