Enum mango_orm::models::output_data::OutputDataMany
source · [−]pub enum OutputDataMany {
Data((Option<Document>, Option<FindOptions>, Collection, Vec<String>, HashMap<String, String>, String)),
}Expand description
To return results after processing queries for many documents.
Variants
Data((Option<Document>, Option<FindOptions>, Collection, Vec<String>, HashMap<String, String>, String))
Implementations
sourceimpl OutputDataMany
impl OutputDataMany
sourcepub fn raw_docs(&self) -> Result<Vec<Document>, Box<dyn Error>>
pub fn raw_docs(&self) -> Result<Vec<Document>, Box<dyn Error>>
Example:
let filter = doc!{};
let output_data = UserProfile::find(filter, None)?;
if output_data.is_valid()? {
// Get raw documents. (Hint: For non-standard operations.)
println!("{:?}", routput_data.raw_docs()?);
}sourcepub fn docs(&self) -> Result<Vec<Document>, Box<dyn Error>>
pub fn docs(&self) -> Result<Vec<Document>, Box<dyn Error>>
Get prepared documents. Hint: For page template.
Example:
let filter = doc!{};
let output_data = UserProfile::find(filter, None)?;
if output_data.is_valid()? {
// Get prepared documents. (Hint: For page template.)
println!("{:?}", routput_data.docs()?);
}sourcepub fn json(&self) -> Result<String, Box<dyn Error>>
pub fn json(&self) -> Result<String, Box<dyn Error>>
Get json-line. Hint: For Ajax.
Example:
let filter = doc!{};
let output_data = UserProfile::find(filter, None)?;
if output_data.is_valid()? {
// Get json-line. (Hint: For Ajax.)
println!("{:?}", routput_data.json()?);
}Trait Implementations
sourceimpl Clone for OutputDataMany
impl Clone for OutputDataMany
sourcefn clone(&self) -> OutputDataMany
fn clone(&self) -> OutputDataMany
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for OutputDataMany
impl Send for OutputDataMany
impl Sync for OutputDataMany
impl Unpin for OutputDataMany
impl !UnwindSafe for OutputDataMany
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