pub struct TimeframeToolbarState {
pub timeframe: Timeframe,
pub sel_range: DateRange,
pub date_picker_open: bool,
pub range_collapsed: bool,
pub timezone: String,
pub timezone_menu_open: bool,
pub session_type: SessionType,
pub session_menu_open: bool,
pub adjust_for_dividends: bool,
pub curr_time: Option<DateTime<Utc>>,
}Expand description
Bottom panel state
Fields§
§timeframe: TimeframeCurrent timeframe
sel_range: DateRangeSelected date range preset
date_picker_open: boolWhether date picker is open
range_collapsed: boolWhether date range dropdown is collapsed (mobile mode)
timezone: StringSelected timezone display string (e.g., “UTC”, “America/New_York”)
Whether timezone menu is open
session_type: SessionTypeCurrent session type: RTH, ETH, ALL (overnight) or 24/7
Whether session menu is open
adjust_for_dividends: boolWhether to adjust data for dividends
curr_time: Option<DateTime<Utc>>Current display time (for timezone display)
Implementations§
Source§impl TimeframeToolbarState
impl TimeframeToolbarState
Sourcepub fn set_timeframe(&mut self, timeframe: Timeframe)
pub fn set_timeframe(&mut self, timeframe: Timeframe)
Set timeframe
Sourcepub fn set_date_range(&mut self, range: DateRange)
pub fn set_date_range(&mut self, range: DateRange)
Set selected date range
Sourcepub fn toggle_date_picker(&mut self)
pub fn toggle_date_picker(&mut self)
Toggle date picker
Sourcepub fn toggle_range_collapsed(&mut self)
pub fn toggle_range_collapsed(&mut self)
Toggle range collapsed mode
Sourcepub fn set_timezone(&mut self, timezone: String)
pub fn set_timezone(&mut self, timezone: String)
Set timezone
Sourcepub fn set_display_timezone(&mut self, zone: &TimezoneMode)
pub fn set_display_timezone(&mut self, zone: &TimezoneMode)
Shows the clock in zone, the chart’s
display_timezone: exchange time in the zone
the chart resolved for it, local time at the system’s present offset from UTC, which the
clock keeps until this is called again.
Toggle timezone menu
Sourcepub fn set_session_type(&mut self, session: SessionType)
pub fn set_session_type(&mut self, session: SessionType)
Set session type
Toggle session menu
Sourcepub fn toggle_adjust_for_dividends(&mut self)
pub fn toggle_adjust_for_dividends(&mut self)
Toggle adjust for dividends
Sourcepub fn update_time(&mut self)
pub fn update_time(&mut self)
Update current time
Sourcepub fn formatted_time(&self) -> String
pub fn formatted_time(&self) -> String
Get formatted time string for display
Sourcepub fn sync_from_app_state(&mut self, app_state: &dyn ChartAppState)
pub fn sync_from_app_state(&mut self, app_state: &dyn ChartAppState)
Sync from application state.
Trait Implementations§
Source§impl Clone for TimeframeToolbarState
impl Clone for TimeframeToolbarState
Source§impl Debug for TimeframeToolbarState
impl Debug for TimeframeToolbarState
Auto Trait Implementations§
impl Freeze for TimeframeToolbarState
impl RefUnwindSafe for TimeframeToolbarState
impl Send for TimeframeToolbarState
impl Sync for TimeframeToolbarState
impl Unpin for TimeframeToolbarState
impl UnsafeUnpin for TimeframeToolbarState
impl UnwindSafe for TimeframeToolbarState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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