Enum mango_orm::widgets::output_data::OutputDataForm
source · [−]pub enum OutputDataForm {
Check((bool, Vec<String>, HashMap<String, Widget>, Document)),
Save((bool, Vec<String>, HashMap<String, Widget>, String)),
Delete((bool, String)),
Stub,
}
Expand description
Output data type
Variants
Check((bool, Vec<String>, HashMap<String, Widget>, Document))
Save((bool, Vec<String>, HashMap<String, Widget>, String))
Delete((bool, String))
Stub
Implementations
sourceimpl OutputDataForm
impl OutputDataForm
sourcepub fn hash(&self) -> Result<String, Box<dyn Error>>
pub fn hash(&self) -> Result<String, Box<dyn Error>>
Example:
let user_profile = UserProfile {...};
let output_data = user_profile.check()?;
let output_data = user_profile.save(None, None)?;
println!("{}", output_data.hash());
sourcepub fn print_err(&self)
pub fn print_err(&self)
Example:
let user_profile = UserProfile {...};
let output_data = user_profile.check()?;
let output_data = user_profile.save(None, None)?;
println!("{}", output_data.print_err());
sourcepub fn object_id(&self) -> Result<ObjectId, Box<dyn Error>>
pub fn object_id(&self) -> Result<ObjectId, Box<dyn Error>>
Get MongoDB ID from hash-line
Example:
let user_profile = UserProfile {...};
let output_data = user_profile.check()?;
let output_data = user_profile.save(None, None)?;
println!("{:?}", output_data.object_id()?);
sourcepub fn to_wig(&self) -> HashMap<String, Widget>
pub fn to_wig(&self) -> HashMap<String, Widget>
Get Map of Widgets ( Wig - Widgets )
Example:
let user_profile = UserProfile {...};
let output_data = user_profile.check()?;
let output_data = user_profile.save(None, None)?;
println!("{:?}", output_data.to_wig());
sourcepub fn to_json(&self) -> Result<String, Box<dyn Error>>
pub fn to_json(&self) -> Result<String, Box<dyn Error>>
Get Json-line
Example:
let user_profile = UserProfile {...};
let output_data = user_profile.check()?;
let output_data = user_profile.save(None, None)?;
println!("{}", output_data.to_json()?);
sourcepub fn to_json_for_admin(&self) -> Result<String, Box<dyn Error>>
pub fn to_json_for_admin(&self) -> Result<String, Box<dyn Error>>
Json-line for admin panel. ( converts a widget map to a list, in the order of the Model fields )
Example:
let user_profile = UserProfile {...};
let output_data = user_profile.save(None, None)?;
println!("{}", output_data.to_json_for_admin()?);
sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Get validation status (boolean)
Example:
let user_profile = UserProfile {...};
let output_data = user_profile.check()?;
let output_data = user_profile.save(None, None)?;
let output_data = user_profile.delete()?;
assert!(result.is_valid());
Trait Implementations
sourceimpl Debug for OutputDataForm
impl Debug for OutputDataForm
sourceimpl HtmlControls for OutputDataForm
impl HtmlControls for OutputDataForm
Auto Trait Implementations
impl RefUnwindSafe for OutputDataForm
impl Send for OutputDataForm
impl Sync for OutputDataForm
impl Unpin for OutputDataForm
impl UnwindSafe for OutputDataForm
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more