Struct aragog::query::Filter [−][src]
Allows to filter a query according to different Comparison
.
as an AQL string with the to_aql
method.
Implementations
impl Filter
[src]
pub fn new(comparison: Comparison) -> Self
[src]
Instantiates a new query filter from a comparison item
Example
let filter = Filter::new(Comparison::field("age").greater_than(10));
pub fn and(self, comparison: Comparison) -> Self
[src]
Appends the filter current condition(s) with a new one with a AND
logic.
Example
let mut filter = Filter::new(Comparison::field("age").greater_than(10)); filter = filter.and(Comparison::field("username").in_str_array(&["felix", "felixm"]));
pub fn or(self, comparison: Comparison) -> Self
[src]
Appends the filter current condition(s) with a new one with a OR
logic.
Example
let mut filter = Filter::new(Comparison::field("age").greater_than(10)); filter = filter.or(Comparison::field("username").in_str_array(&["felix", "felixm"]));
pub fn to_aql(&self, collection_id: &str) -> String
[src]
Renders the AQL string corresponding to the current Filter
. The query will go out of scope.
Example
let mut filter = Filter::new(Comparison::field("age").greater_than(10)). or(Comparison::field("username").in_str_array(&["felix", "felixm"])); assert_eq!(filter.to_aql("i"), String::from(r#"i.age > 10 || i.username IN ["felix", "felixm"]"#));
Trait Implementations
impl Clone for Filter
[src]
impl Debug for Filter
[src]
impl From<Comparison> for Filter
[src]
fn from(comparison: Comparison) -> Self
[src]
Auto Trait Implementations
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnwindSafe for Filter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,