pub struct StockScreener { /* private fields */ }Expand description
Stock screener with asset-class defaults
Implementations§
Source§impl StockScreener
impl StockScreener
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a screener with default stock fields, America market, and market-cap sort.
Sourcepub fn set_markets(
&mut self,
markets: impl IntoIterator<Item = Market>,
) -> &mut Self
pub fn set_markets( &mut self, markets: impl IntoIterator<Item = Market>, ) -> &mut Self
Sets market filters
Sourcepub fn set_symbol_types(
&mut self,
symbol_types: impl IntoIterator<Item = impl AsRef<str>>,
) -> Result<&mut Self>
pub fn set_symbol_types( &mut self, symbol_types: impl IntoIterator<Item = impl AsRef<str>>, ) -> Result<&mut Self>
Adds stock type and subtype filters
§Errors
Returns TvscreenerError::InvalidRequest when a symbol type is unknown or
has no type mapping.
Source§impl StockScreener
impl StockScreener
Sourcepub async fn get(&self) -> Result<Vec<ScreenerRow>>
pub async fn get(&self) -> Result<Vec<ScreenerRow>>
Sourcepub fn select(
&mut self,
fields: impl IntoIterator<Item = FieldDef>,
) -> &mut Self
pub fn select( &mut self, fields: impl IntoIterator<Item = FieldDef>, ) -> &mut Self
Replaces selected columns
Sourcepub fn select_all(&mut self) -> &mut Self
pub fn select_all(&mut self) -> &mut Self
Reloads default columns via $crate::core::Screener::select_all.
§Panics
Panics if set_all_fields_fn was not registered in new() (typed constructors always do).
Sourcepub const fn set_range(&mut self, from_range: u32, to_range: u32) -> &mut Self
pub const fn set_range(&mut self, from_range: u32, to_range: u32) -> &mut Self
Sets the result window
Sourcepub fn where_condition(
&mut self,
condition: FieldCondition,
) -> Result<&mut Self>
pub fn where_condition( &mut self, condition: FieldCondition, ) -> Result<&mut Self>
Adds a filter from a $crate::filter::FieldCondition.
§Errors
Propagates $crate::core::Screener::where_condition errors.
Trait Implementations§
Source§impl Clone for StockScreener
impl Clone for StockScreener
Source§fn clone(&self) -> StockScreener
fn clone(&self) -> StockScreener
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StockScreener
impl Debug for StockScreener
Auto Trait Implementations§
impl !RefUnwindSafe for StockScreener
impl !UnwindSafe for StockScreener
impl Freeze for StockScreener
impl Send for StockScreener
impl Sync for StockScreener
impl Unpin for StockScreener
impl UnsafeUnpin for StockScreener
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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