Skip to main content

AccountPanel

Struct AccountPanel 

Source
pub struct AccountPanel {
    pub broker: String,
    pub accounts: Vec<String>,
    pub active: usize,
    /* private fields */
}
Expand description

The account panel of Trading, shown with Trading::show_account_panel.

A tab named after the broker sits above the account selectors and the account’s summary: balance, equity, realised and unrealised profit and loss, margin, available funds and the margin of working orders, each shown when the broker reports it. The tab marks a broker that reports that it is connecting or disconnected, until it reports that it is live. Below are the positions, working orders, finished orders, balance changes and trading journal the broker pushes, each with a column chooser and an export. Order History also lists individual executions. A position offers close, and an order offers edit and cancel on hover; each waits for the user’s confirmation like the chart’s lines. Clicking a symbol asks the host to show it. Each history keeps the most recent 1,000 entries; active orders are retained independently. Scrolling to the end of a history asks Broker::history for the entries before its oldest one, a page at a time, until the broker has nothing older or the history lists 1,000 entries. Each entry is listed once, whether a page or the broker’s stream brings it first, and pages change no working order or position.

Fields§

§broker: String

The broker’s name, shown on the tab and in the account selector.

§accounts: Vec<String>

The accounts the host offers at the broker, such as “Paper 1”. The selector shows the active one with the account’s currency and switches between them.

§active: usize

The index in accounts of the connected account.

Trait Implementations§

Source§

impl Default for AccountPanel

Source§

fn default() -> AccountPanel

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.