Enum mango_orm::widgets::output_data::OutputData
source · [−]pub enum OutputData {
Check((bool, Vec<String>, HashMap<String, Widget>, Document)),
Save((bool, Vec<String>, HashMap<String, Widget>)),
Delete((bool, String)),
Stub,
}
Expand description
Helper methods for converting output data (use in the paladins.rs module).
Variants
Check((bool, Vec<String>, HashMap<String, Widget>, Document))
Save((bool, Vec<String>, HashMap<String, Widget>))
Delete((bool, String))
Stub
Implementations
sourceimpl OutputData
impl OutputData
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 OutputData
impl Debug for OutputData
sourceimpl HtmlControls for OutputData
impl HtmlControls for OutputData
Auto Trait Implementations
impl RefUnwindSafe for OutputData
impl Send for OutputData
impl Sync for OutputData
impl Unpin for OutputData
impl UnwindSafe for OutputData
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