Skip to main content

egui_charts/services/
mod.rs

1//! Services a host supplies, each through a small trait. Charts consume `Marks`, `Signals` and
2//! `Posts` and keep their drawings in `Storage`, symbol choosers consume `SymbolSearch`, the
3//! alerts panel `Alerts`, the watchlist `Quotes`, the notifications panel `Notifications` and the
4//! chats panel `Chats`. `SettingsStore` and the layout menu keep settings and layouts in `Storage`;
5//! other contracts define the host side of the assembled terminal. [`PaperAccount`] is a
6//! ready-made [`Broker`] that simulates an account, and `AlertEngine`, with the `alert-engine`
7//! feature, an [`Alerts`] service that evaluates alerts on the bars the host feeds it.
8//! `OrderFlowDetectors`, with the `detectors` feature, is a [`Signals`] service that finds
9//! order-flow events in the trades and depth the host feeds it.
10//!
11//! Like [`Datafeed`](crate::data::Datafeed), every service is held as an `Arc<dyn Trait>` and
12//! called on the UI thread. Its methods return at once and answer later through a
13//! [`Reply`](crate::data::Reply), or push updates through an [`Events`] stream, from any thread,
14//! runtime or browser task.
15
16#[cfg(feature = "alert-engine")]
17mod alert_engine;
18#[cfg(all(feature = "alert-engine", feature = "studies"))]
19mod alert_evaluator;
20#[cfg(feature = "alert-engine")]
21mod alert_feed;
22mod alerts;
23mod broker;
24mod chats;
25#[cfg(feature = "detectors")]
26mod detectors;
27#[cfg(feature = "widget")]
28pub(crate) mod document;
29#[cfg_attr(
30    not(any(test, feature = "widget")),
31    expect(dead_code, reason = "only the terminal consumes the listener")
32)]
33mod events;
34mod marks;
35mod notifications;
36mod paper;
37mod posts;
38#[cfg(feature = "widget")]
39mod profile_directory;
40mod profiles;
41mod quotes;
42mod search;
43#[cfg(feature = "widget")]
44#[cfg_attr(docsrs, doc(cfg(feature = "widget")))]
45mod settings;
46mod sharing;
47mod signals;
48mod storage;
49
50#[cfg(feature = "alert-engine")]
51#[cfg_attr(docsrs, doc(cfg(feature = "alert-engine")))]
52pub use alert_engine::AlertEngine;
53#[cfg(all(feature = "alert-engine", feature = "studies"))]
54pub use alert_evaluator::AlertEvaluator;
55#[cfg(feature = "alert-engine")]
56pub use alert_feed::{AlertData, AlertFeed};
57pub use alerts::{AlertEvent, Alerts};
58pub use broker::{AccountEvent, Broker, HistoryKind, HistoryPage, HistoryRequest};
59pub use chats::{
60    ChatCapabilities, ChatEvent, ChatMessage, ChatUser, Chats, NewChatRoom, NewChatRoomKind,
61};
62#[cfg(feature = "detectors")]
63#[cfg_attr(docsrs, doc(cfg(feature = "detectors")))]
64pub use detectors::{
65    AbsorptionRule, BigTradeRule, CountAlert, CountWindow, DetectionAlert, DetectionCounts,
66    DetectionKind, Detector, DetectorSettings, IcebergRule, LiquidityRule, OrderFlowDetectors,
67    StopRunRule, StopSweepRule, Threshold,
68};
69pub use events::Events;
70#[cfg(feature = "widget")]
71pub(crate) use events::Listener;
72pub use marks::{Marks, MarksPage, MarksRequest};
73pub use notifications::{Notification, NotificationTarget, Notifications};
74pub use paper::PaperAccount;
75pub use posts::Posts;
76#[cfg(feature = "widget")]
77#[cfg_attr(docsrs, doc(cfg(feature = "widget")))]
78pub use profile_directory::{FollowOperation, FollowStatus, ProfileDirectory};
79pub use profiles::{Profile, ProfileEvent, ProfileId, Profiles};
80pub use quotes::Quotes;
81pub use search::{ExpressionError, SymbolExpression, SymbolQuery, SymbolSearch};
82#[cfg(feature = "widget")]
83#[cfg_attr(docsrs, doc(cfg(feature = "widget")))]
84pub use settings::{MarketHeatmapSelection, SettingsStore, UserSettings};
85pub use sharing::{ShareKind, ShareLink, ShareOffer, Sharing};
86pub use signals::{SignalEvent, Signals};
87pub use storage::{ConflictChoice, Revision, SaveOutcome, Storage, StoreKind, Versioned};