Skip to main content

ScreenerField

Trait ScreenerField 

Source
pub trait ScreenerField:
    Clone
    + Serialize
    + 'static {
    // Required method
    fn as_str(&self) -> &'static str;
}
Expand description

A typed screener field usable in custom query conditions, sorting, and response field selection.

Both EquityField and FundField implement this trait.

The Serialize bound ensures field values can be included in the JSON body sent to Yahoo Finance (e.g., in sortField and includeFields). The serialization always produces the raw Yahoo API field name string.

Required Methods§

Source

fn as_str(&self) -> &'static str

Returns the Yahoo Finance API field name string.

For example, EquityField::PeRatio.as_str() returns "peratio.lasttwelvemonths".

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§