Skip to main content

FinancialData

Struct FinancialData 

Source
#[non_exhaustive]
pub struct FinancialData<F: Format = Both> {
Show 30 fields pub current_price: Option<F::Value<f64>>, pub current_ratio: Option<F::Value<f64>>, pub debt_to_equity: Option<F::Value<f64>>, pub earnings_growth: Option<F::Value<f64>>, pub ebitda: Option<F::Value<i64>>, pub ebitda_margins: Option<F::Value<f64>>, pub financial_currency: Option<String>, pub free_cashflow: Option<F::Value<i64>>, pub gross_margins: Option<F::Value<f64>>, pub gross_profits: Option<F::Value<i64>>, pub max_age: Option<i64>, pub number_of_analyst_opinions: Option<F::Value<i64>>, pub operating_cashflow: Option<F::Value<i64>>, pub operating_margins: Option<F::Value<f64>>, pub profit_margins: Option<F::Value<f64>>, pub quick_ratio: Option<F::Value<f64>>, pub recommendation_key: Option<String>, pub recommendation_mean: Option<F::Value<f64>>, pub return_on_assets: Option<F::Value<f64>>, pub return_on_equity: Option<F::Value<f64>>, pub revenue_growth: Option<F::Value<f64>>, pub revenue_per_share: Option<F::Value<f64>>, pub target_high_price: Option<F::Value<f64>>, pub target_low_price: Option<F::Value<f64>>, pub target_mean_price: Option<F::Value<f64>>, pub target_median_price: Option<F::Value<f64>>, pub total_cash: Option<F::Value<i64>>, pub total_cash_per_share: Option<F::Value<f64>>, pub total_debt: Option<F::Value<i64>>, pub total_revenue: Option<F::Value<i64>>,
}
Expand description

Financial data and key metrics

Contains financial ratios, margins, cash flow, and analyst recommendations.

The type parameter F controls how numeric fields are represented:

  • FinancialData / FinancialData<Both>default; fields hold FormattedValue<T>
  • FinancialData<Raw> — fields hold T directly (e.g. Option<f64>)
  • FinancialData<Pretty> — fields hold Option<String> (human-readable)

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§current_price: Option<F::Value<f64>>

Current stock price

§current_ratio: Option<F::Value<f64>>

Current ratio (current assets / current liabilities)

§debt_to_equity: Option<F::Value<f64>>

Debt to equity ratio

§earnings_growth: Option<F::Value<f64>>

Earnings growth rate

§ebitda: Option<F::Value<i64>>

EBITDA (Earnings Before Interest, Taxes, Depreciation, and Amortization)

§ebitda_margins: Option<F::Value<f64>>

EBITDA margins

§financial_currency: Option<String>

Currency code for financial data

§free_cashflow: Option<F::Value<i64>>

Free cash flow

§gross_margins: Option<F::Value<f64>>

Gross profit margins

§gross_profits: Option<F::Value<i64>>

Total gross profits

§max_age: Option<i64>

Maximum age of data in seconds

§number_of_analyst_opinions: Option<F::Value<i64>>

Number of analyst opinions

§operating_cashflow: Option<F::Value<i64>>

Operating cash flow

§operating_margins: Option<F::Value<f64>>

Operating margins

§profit_margins: Option<F::Value<f64>>

Profit margins

§quick_ratio: Option<F::Value<f64>>

Quick ratio (quick assets / current liabilities)

§recommendation_key: Option<String>

Recommendation key (e.g., “buy”, “hold”, “sell”)

§recommendation_mean: Option<F::Value<f64>>

Mean analyst recommendation (1.0 = strong buy, 5.0 = sell)

§return_on_assets: Option<F::Value<f64>>

Return on assets (ROA)

§return_on_equity: Option<F::Value<f64>>

Return on equity (ROE)

§revenue_growth: Option<F::Value<f64>>

Revenue growth rate

§revenue_per_share: Option<F::Value<f64>>

Revenue per share

§target_high_price: Option<F::Value<f64>>

Highest analyst price target

§target_low_price: Option<F::Value<f64>>

Lowest analyst price target

§target_mean_price: Option<F::Value<f64>>

Mean analyst price target

§target_median_price: Option<F::Value<f64>>

Median analyst price target

§total_cash: Option<F::Value<i64>>

Total cash and cash equivalents

§total_cash_per_share: Option<F::Value<f64>>

Total cash per share

§total_debt: Option<F::Value<i64>>

Total debt

§total_revenue: Option<F::Value<i64>>

Total revenue

Implementations§

Source§

impl FinancialData<Both>

Source

pub fn into_raw(self) -> FinancialData<Raw>

Convert into a Raw view, extracting .raw from each FormattedValue field.

Source

pub fn as_raw(&self) -> FinancialData<Raw>

Clone and convert into a Raw view.

Source

pub fn into_pretty(self) -> FinancialData<Pretty>

Convert into a Pretty view, extracting .fmt from each FormattedValue field.

Source

pub fn as_pretty(&self) -> FinancialData<Pretty>

Clone and convert into a Pretty view.

Trait Implementations§

Source§

impl<F: Clone + Format> Clone for FinancialData<F>
where F::Value<f64>: Clone, F::Value<i64>: Clone,

Source§

fn clone(&self) -> FinancialData<F>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F: Debug + Format> Debug for FinancialData<F>
where F::Value<f64>: Debug, F::Value<i64>: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: Default + Format> Default for FinancialData<F>
where F::Value<f64>: Default, F::Value<i64>: Default,

Source§

fn default() -> FinancialData<F>

Returns the “default value” for a type. Read more
Source§

impl<'de, F: Format> Deserialize<'de> for FinancialData<F>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<FinancialData> for FinancialData<Raw>

Source§

fn from(v: FinancialData<Both>) -> Self

Converts to this type from the input type.
Source§

impl From<FinancialData> for FinancialData<Pretty>

Source§

fn from(v: FinancialData<Both>) -> Self

Converts to this type from the input type.
Source§

impl<F: PartialEq + Format> PartialEq for FinancialData<F>
where F::Value<f64>: PartialEq, F::Value<i64>: PartialEq,

Source§

fn eq(&self, other: &FinancialData<F>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<F: Format> Serialize for FinancialData<F>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<F: PartialEq + Format> StructuralPartialEq for FinancialData<F>
where F::Value<f64>: PartialEq, F::Value<i64>: PartialEq,

Source§

impl Translatable for FinancialData

Source§

fn visit_translatable(&mut self, visit: &mut dyn FnMut(&mut String))

Visit every translatable string field in a stable order.
Source§

fn after_translate(&mut self)

Hook invoked after translations have been written back, for types that maintain derived text (e.g. a transcript’s joined full text).

Auto Trait Implementations§

§

impl<F> Freeze for FinancialData<F>
where Option<<F as Format>::Value<f64>>: Freeze, Option<<F as Format>::Value<i64>>: Freeze,

§

impl<F> RefUnwindSafe for FinancialData<F>
where Option<<F as Format>::Value<f64>>: RefUnwindSafe, Option<<F as Format>::Value<i64>>: RefUnwindSafe,

§

impl<F> Send for FinancialData<F>
where Option<<F as Format>::Value<f64>>: Send, Option<<F as Format>::Value<i64>>: Send,

§

impl<F> Sync for FinancialData<F>
where Option<<F as Format>::Value<f64>>: Sync, Option<<F as Format>::Value<i64>>: Sync,

§

impl<F> Unpin for FinancialData<F>
where Option<<F as Format>::Value<f64>>: Unpin, Option<<F as Format>::Value<i64>>: Unpin,

§

impl<F> UnsafeUnpin for FinancialData<F>
where Option<<F as Format>::Value<f64>>: UnsafeUnpin, Option<<F as Format>::Value<i64>>: UnsafeUnpin,

§

impl<F> UnwindSafe for FinancialData<F>
where Option<<F as Format>::Value<f64>>: UnwindSafe, Option<<F as Format>::Value<i64>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Key for T
where T: Clone,

Source§

fn align() -> usize

The alignment necessary for the key. Must return a power of two.
Source§

fn size(&self) -> usize

The size of the key in bytes.
Source§

unsafe fn init(&self, ptr: *mut u8)

Initialize the key in the given memory location. Read more
Source§

unsafe fn get<'a>(ptr: *const u8) -> &'a T

Get a reference to the key from the given memory location. Read more
Source§

unsafe fn drop_in_place(ptr: *mut u8)

Drop the key in place. Read more
Source§

impl<T> PlanCallbackArgs for T

Source§

impl<T> PlanCallbackOut for T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more