pub struct OutputDataCheck { /* private fields */ }
Expand description

Helper methods for converting output data (use in the paladins.rs module).

Implementations

Output data initialization.

Get Hash-line

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

Get MongoDB ID from hash-line

Example:
let model_name = ModelName {...};
let output_data = model_name.check()?;
let output_data = model_name.save(None, None)?;
println!("{:?}", output_data.object_id()?);

Get/Set final document ( Wig - Widgets )

Example:
let model_name = ModelName {...};
let output_data = model_name.check()?;
let output_data = model_name.save(None, None)?;
println!("{:?}", output_data.get_doc());
println!("{:?}", output_data.set_doc(Some(new_doc)));

Get/Set Map of Widgets ( Wig - Widgets )

Example:
let model_name = ModelName {...};
let output_data = model_name.check()?;
let output_data = model_name.save(None, None)?;
println!("{:?}", output_data.to_wig());
println!("{:?}", output_data.set_wig(updated_widget_map));

Get Json-line

Example:
let model_name = ModelName {...};
let output_data = model_name.check()?;
let output_data = model_name.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 model_name = ModelName {...};
let output_data = model_name.check()?;
let output_data = model_name.save(None, None)?;
println!("{}", output_data.to_json_for_admin()?);

Get Html-code

Example:
let model_name = ModelName {...};
let output_data = model_name.check()?;
let output_data = model_name.save(None, None)?;
//
println!("{}", output_data.to_html(None, None, None)?);
// OR
println!("{}", output_data.to_html(Some("/login"), Some(HttpMethod::POST), Some(Enctype::Multipart))?);

Get validation status (boolean).

Example:
let model_name = ModelName {...};
let output_data = model_name.check()?;
let output_data = model_name.save(None, None)?;
assert!(output_data.is_valid());

Get errors message ( for user side ).

Example:
let model_name = ModelName {...};
let output_data = model_name.check()?;
let output_data = model_name.save(None, None)?;
if output_data.is_valid() {
    println!("{}", output_data.err_msg());
}

Printing errors to the console ( for development ).

Example:
let model_name = ModelName {...};
let output_data = model_name.check()?;
let output_data = model_name.save(None, None)?;
if output_data.is_valid() {
    output_data.print_err();
}

Trait Implementations

Get widgets map from document ( presence of widgets ).

Get json-line from widget map.

Get model instance from document. Hint: For the save, update, delete operations. Read more

Get prepared document. Hint: Converting data types to model-friendly formats. Read more

Get prepared documents ( missing widgets ).

Get json-line from document list ( missing widgets ).

Formats the value using the given formatter. Read more

Rendering HTML-controls code for Form. Hint: 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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more