pub struct QueryCondition<F: ScreenerField> {
pub field: F,
pub operator: Operator,
pub value: ConditionValue,
}Expand description
A typed filter condition for a screener query.
Created via ScreenerFieldExt methods on a field enum variant. The custom
Serialize impl produces the exact format Yahoo Finance expects:
{"operator": "gt", "operands": ["fieldname", value]}.
§Example
use finance_query::{EquityField, ScreenerFieldExt};
let volume_filter = EquityField::AvgDailyVol3M.gt(200_000.0);
let region_filter = EquityField::Region.eq_str("us");
let pe_filter = EquityField::PeRatio.between(10.0, 25.0);Fields§
§field: FThe field to filter on.
operator: OperatorThe comparison operator.
value: ConditionValueThe filter value(s).
Trait Implementations§
Source§impl<F: Clone + ScreenerField> Clone for QueryCondition<F>
impl<F: Clone + ScreenerField> Clone for QueryCondition<F>
Source§fn clone(&self) -> QueryCondition<F>
fn clone(&self) -> QueryCondition<F>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<F: Debug + ScreenerField> Debug for QueryCondition<F>
impl<F: Debug + ScreenerField> Debug for QueryCondition<F>
Source§impl<F: ScreenerField> Serialize for QueryCondition<F>
impl<F: ScreenerField> Serialize for QueryCondition<F>
Auto Trait Implementations§
impl<F> Freeze for QueryCondition<F>where
F: Freeze,
impl<F> RefUnwindSafe for QueryCondition<F>where
F: RefUnwindSafe,
impl<F> Send for QueryCondition<F>where
F: Send,
impl<F> Sync for QueryCondition<F>where
F: Sync,
impl<F> Unpin for QueryCondition<F>where
F: Unpin,
impl<F> UnsafeUnpin for QueryCondition<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for QueryCondition<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more