pub struct AlertDialog {
pub config: AlertDialogConfig,
pub is_open: bool,
pub alert: Alert,
pub sources: Vec<(AlertSource, String)>,
pub watchlists: Vec<(String, String)>,
pub timezone: TimezoneId,
/* private fields */
}Expand description
A dialog that creates or edits the same alert type the host stores and evaluates.
Fields§
§config: AlertDialogConfigLayout dimensions.
is_open: boolWhether the modal is visible.
alert: AlertStaged edits. Cancel never submits them.
sources: Vec<(AlertSource, String)>Host-provided study outputs and drawings, as stable identifiers and display names.
watchlists: Vec<(String, String)>Host-provided watchlist identifiers and display names.
timezone: TimezoneIdThe zone the expiry date and time are entered in, UTC by default. Set it before
open or edit, usually to the chart’s time zone.
Implementations§
Source§impl AlertDialog
impl AlertDialog
Sourcepub fn set_storage(&mut self, storage: Arc<dyn Storage>)
pub fn set_storage(&mut self, storage: Arc<dyn Storage>)
Load presets from the host storage service. A failed load never permits overwriting it.
Sourcepub fn open(&mut self, symbol: String, price: f64)
pub fn open(&mut self, symbol: String, price: f64)
Open a fresh price alert at the last or hovered price, discarding earlier cancelled edits.
Sourcepub fn edit(&mut self, alert: Alert)
pub fn edit(&mut self, alert: Alert)
Stage an existing alert, retaining its host identifier and status when saved.
Sourcepub fn sync_open_state(&mut self, should_be_open: bool)
pub fn sync_open_state(&mut self, should_be_open: bool)
Follow an external close flag.
Sourcepub fn show(&mut self, ctx: &Context) -> AlertDialogAction
pub fn show(&mut self, ctx: &Context) -> AlertDialogAction
Poll preset replies and render the modal. Submit Create through the host alerts service.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AlertDialog
impl !UnwindSafe for AlertDialog
impl Freeze for AlertDialog
impl Send for AlertDialog
impl Sync for AlertDialog
impl Unpin for AlertDialog
impl UnsafeUnpin for AlertDialog
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> 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