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

Example:
let user_profile = UserProfile {...};
let output_data = user_profile.check()?;
let output_data = user_profile.save(None, None)?;
println!("{}", output_data.hash());
Example:
let user_profile = UserProfile {...};
let output_data = user_profile.check()?;
let output_data = user_profile.save(None, None)?;
println!("{}", output_data.print_err());

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()?);

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());

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()?);

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()?);

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());

Get Document

Example:
let user_profile = UserProfile {...};
let output_data = user_profile.check()?;
println!("{:?}", user_profile.to_doc());

A description of the error if the document was not deleted. (Main use for admin panel.)

Example:
let user_profile = UserProfile {...};
user_profile.save(None, None)?;
let output_data = user_profile.delete()?;
println!("{}", output_data.err_msg());

Trait Implementations

Formats the value using the given formatter. Read more

Get Html-line

Example:
let user_profile = UserProfile {...};
let output_data = user_profile.check()?;
let output_data = user_profile.save(None, None)?;
println!("{}", output_data.to_html());

Rendering HTML-controls code for Form. ( If necessary, customize the code generation yourself using html and css from Bootstrap, Material Design, etc. ) Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.