pub struct DashboardContext {
pub rules_path: PathBuf,
pub rules: RulesConfig,
pub state: AgentState,
pub state_path: PathBuf,
pub daemon: DaemonStatus,
pub log_tail: Vec<String>,
pub market_status: ResolvedMarketStatus,
pub auth_reminder: Option<AuthReminder>,
}Fields§
§rules_path: PathBuf§rules: RulesConfig§state: AgentState§state_path: PathBuf§daemon: DaemonStatus§log_tail: Vec<String>§market_status: ResolvedMarketStatus§auth_reminder: Option<AuthReminder>Implementations§
Source§impl DashboardContext
impl DashboardContext
pub fn load(rules_path: &Path) -> Result<Self>
pub fn load_with_snapshot( rules_path: &Path, live_market: Option<&MarketSnapshot>, ) -> Result<Self>
pub fn to_json(&self) -> Value
pub fn portfolio_risk_usd(&self) -> f64
pub fn monitor_interval_minutes(&self) -> u64
pub fn min_open_position_dte(&self) -> Option<i64>
pub fn has_open_positions(&self) -> bool
Sourcepub fn effective_session(&self) -> &'static str
pub fn effective_session(&self) -> &'static str
Session the agent should be in right now (from market hours, not stale state file).
pub fn expected_tick_interval_secs(&self) -> u64
pub fn last_tick_age_secs(&self) -> Option<i64>
pub fn tick_is_stale(&self) -> bool
Trait Implementations§
Source§impl Clone for DashboardContext
impl Clone for DashboardContext
Source§fn clone(&self) -> DashboardContext
fn clone(&self) -> DashboardContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DashboardContext
impl RefUnwindSafe for DashboardContext
impl Send for DashboardContext
impl Sync for DashboardContext
impl Unpin for DashboardContext
impl UnsafeUnpin for DashboardContext
impl UnwindSafe for DashboardContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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