Skip to main content

FloatingReplayControl

Struct FloatingReplayControl 

Source
pub struct FloatingReplayControl {
    pub state: ReplayControlState,
    /* private fields */
}
Expand description

Floating replay control widget

Fields§

§state: ReplayControlState

Current state (public for external access)

Implementations§

Source§

impl FloatingReplayControl

Source

pub fn new() -> Self

Create a new floating replay control

Source

pub fn set_dock_rect(&mut self, rect: Rect)

Dock the bar in rect, usually the chart’s rect.

The bar opens centred at the bottom of this rect and can be dragged only within it. Call it before Self::show in each frame; without it the bar docks in the window’s content rect.

Source

pub fn set_update_intervals( &mut self, current: Timeframe, available: Vec<Timeframe>, )

Supplies source intervals the host can serve. An empty list hides the selector. Selecting one emits an intent; the host reloads that source and retains the cursor time. Offer Timeframe::Ticks of one for trade-by-trade updates when the host holds the trades (see Chart::set_replay_source).

Source

pub fn show_control(&mut self)

Show the control (clears user_dismissed flag)

Source

pub fn hide_control(&mut self)

Hide the control

Source

pub fn dismiss(&mut self)

Hide control via user action (sets user_dismissed flag to prevent auto-show)

Source

pub fn is_visible(&self) -> bool

Check if visible

Source

pub fn is_user_dismissed(&self) -> bool

Check if user explicitly dismissed (prevents auto-show)

Source

pub fn update_state(&mut self, state: ReplayControlState)

Update the state

Source

pub fn set_playing(&mut self, playing: bool)

Set playing state

Source

pub fn sync_from( &mut self, active: bool, playing: bool, speed: f32, current_bar: usize, total_bars: usize, )

Sync replay control state from external values.

Drives visibility and playback display from central replay state.

Source

pub fn set_speed(&mut self, speed: f32)

Set speed

Source

pub fn set_symbol(&mut self, symbol: &str)

Set symbol

Source

pub fn show(&mut self, ctx: &Context) -> ReplayControlAction

Show the floating control and return any action

Source

pub fn shortcut(&self, ctx: &Context) -> ReplayControlAction

The action of a shortcut pressed this frame, which takes its key.

Shortcuts act only while no text field has focus, no popup is open and no control outside the background layer has focus, so keys typed into a field, meant for an open popup or pressing a focused button in the bar or a dialog never reach the replay. A focused chart in a panel keeps them.

Trait Implementations§

Source§

impl Default for FloatingReplayControl

Source§

fn default() -> Self

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

Auto Trait Implementations§

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
§

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

§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> MaybeSend for T
where T: Send + Sync + ?Sized,

§

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

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

type Error = Infallible

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.