pub struct SymbolHeader {
pub instrument: Instrument,
pub timeframe: String,
pub ohlc: OhlcData,
pub quote: Option<Quote>,
pub config: SymbolHeaderConfig,
}Expand description
Symbol Header Widget
Fields§
§instrument: InstrumentInstrument whose quote is shown.
timeframe: StringChart interval label.
ohlc: OhlcDataPrice and volume readout displayed in the header.
quote: Option<Quote>The symbol’s quote, such as the one WatchlistPanel::quote holds. Its bid and ask show
when both are known.
config: SymbolHeaderConfigDisplay and layout options for this component.
Implementations§
Source§impl SymbolHeader
impl SymbolHeader
Sourcepub fn new(instrument: Instrument, timeframe: impl Into<String>) -> Self
pub fn new(instrument: Instrument, timeframe: impl Into<String>) -> Self
Create a new symbol header for the given symbol
Sourcepub fn with_quote(self, quote: Quote) -> Self
pub fn with_quote(self, quote: Quote) -> Self
Set the quote whose bid and ask are shown
Sourcepub fn with_config(self, config: SymbolHeaderConfig) -> Self
pub fn with_config(self, config: SymbolHeaderConfig) -> Self
Set display configuration
Sourcepub fn show_with_quote_action(
&self,
ui: &mut Ui,
) -> (Response, Option<QuoteSide>)
pub fn show_with_quote_action( &self, ui: &mut Ui, ) -> (Response, Option<QuoteSide>)
Show the symbol header and return the Sell or Buy box the user clicked, for
Trading::trade.
Auto Trait Implementations§
impl Freeze for SymbolHeader
impl RefUnwindSafe for SymbolHeader
impl Send for SymbolHeader
impl Sync for SymbolHeader
impl Unpin for SymbolHeader
impl UnsafeUnpin for SymbolHeader
impl UnwindSafe for SymbolHeader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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