Enum green_barrel::models::output_data::OutputData
source · [−]Expand description
Output data for delete(), update_password(), delete_many(), delete_one, drop() methods.
Variants
Delete((bool, String, i64))
UpdatePassword((bool, String))
Implementations
sourceimpl OutputData
impl OutputData
sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Get validation status (boolean).
Example:
let mut model_name = ModelName::new()?;
let output_data = model_name.delete()?;
// or
let output_data = model_name.update_password()?;
assert!(output_data.is_valid());
sourcepub fn err_msg(&self) -> String
pub fn err_msg(&self) -> String
Description of the error if the document was not deleted or the password was not updated. (Main use for admin panel.)
Example:
let mut model_name = ModelName::new()?;
let output_data = model_name.delete()?;
// or
let output_data = model_name.update_password()?;
if output_data.is_valid() {
println!("{}", output_data.err_msg());
}
Trait Implementations
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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