Trait green_barrel::models::Main

source ·
pub trait Main {
Show 13 methods // Required methods fn key() -> Result<String, Box<dyn Error>>; fn custom_to_json_val() -> Result<Value, Box<dyn Error>> where Self: DeserializeOwned + Sized; fn generate_metadata() -> Result<Meta, Box<dyn Error>> where Self: DeserializeOwned + Sized; fn hash(&self) -> String; fn set_hash(&mut self, value: String); fn obj_id(&self) -> Result<Option<ObjectId>, Box<dyn Error>>; fn set_obj_id(&mut self, object_id: ObjectId); fn created_at(&self) -> String; fn set_created_at(&mut self, value: String); fn updated_at(&self) -> String; fn set_updated_at(&mut self, value: String); fn self_to_json_val(&self) -> Result<Value, Box<dyn Error>>; // Provided method fn injection<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( client: &'life0 Client, app_name: &'life1 str, unique_app_key: &'life2 str, collection_name: &'life3 str, model_json: &'life4 mut Value, fields_name: &'life5 Vec<String> ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + 'async_trait>> where Self: DeserializeOwned + Sized + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait { ... }
}
Expand description

Model options and field type map for Form.

Required Methods§

source

fn key() -> Result<String, Box<dyn Error>>

Get model key ( to access model metadata in cache ).

source

fn custom_to_json_val() -> Result<Value, Box<dyn Error>>where Self: DeserializeOwned + Sized,

Model instance from create method, convert to intermediate state serde_json::value::Value, with the addition of Html-ID and data validation.

source

fn generate_metadata() -> Result<Meta, Box<dyn Error>>where Self: DeserializeOwned + Sized,

Generate metadata of Model.

source

fn hash(&self) -> String

Getter and Setter for field hash.

source

fn set_hash(&mut self, value: String)

source

fn obj_id(&self) -> Result<Option<ObjectId>, Box<dyn Error>>

ObjectId from hash field.

source

fn set_obj_id(&mut self, object_id: ObjectId)

ObjectId to hash field.

source

fn created_at(&self) -> String

Getter and Setter for field created_at.

source

fn set_created_at(&mut self, value: String)

source

fn updated_at(&self) -> String

Getter and Setter for field updated_at.

source

fn set_updated_at(&mut self, value: String)

source

fn self_to_json_val(&self) -> Result<Value, Box<dyn Error>>

Serializing the model instance to serde_json::Value format.

Provided Methods§

source

fn injection<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( client: &'life0 Client, app_name: &'life1 str, unique_app_key: &'life2 str, collection_name: &'life3 str, model_json: &'life4 mut Value, fields_name: &'life5 Vec<String> ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + 'async_trait>>where Self: DeserializeOwned + Sized + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Enrich field type map with values for dynamic fields type.

Implementors§