#[non_exhaustive]pub enum AlertEvent {
Upsert(Alert),
Remove(AlertId),
Clear,
Triggered {
id: AlertId,
time: DateTime<Utc>,
price: Option<f64>,
},
TriggeredForSymbol {
id: AlertId,
symbol: String,
time: DateTime<Utc>,
price: Option<f64>,
message: String,
},
}Expand description
A change to the host’s alerts, pushed through the stream Alerts::watch received.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Upsert(Alert)
Adds the alert, or replaces the one with its id. An alert without an id is ignored.
Remove(AlertId)
Removes the alert with this id, if any.
Clear
Removes every alert, so a host that reconnects can push its full list again.
Triggered
The alert fired at time, at price (finite) when the host knows it. The terminal shows a
popup and logs it; push an Upsert as well when the alert’s status changes.
Fields
TriggeredForSymbol
A trigger with its actual subject, including a member of a watchlist alert. The panel retains this symbol even after the alert or watchlist changes.
Fields
§
message: StringThe alert’s message with its placeholders filled in, as Alert::expand_message
does, empty if the alert has none. The terminal shows it in the popup and the log.
Trait Implementations§
Source§impl Clone for AlertEvent
impl Clone for AlertEvent
Source§fn clone(&self) -> AlertEvent
fn clone(&self) -> AlertEvent
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 moreSource§impl Debug for AlertEvent
impl Debug for AlertEvent
Source§impl PartialEq for AlertEvent
impl PartialEq for AlertEvent
impl StructuralPartialEq for AlertEvent
Auto Trait Implementations§
impl Freeze for AlertEvent
impl RefUnwindSafe for AlertEvent
impl Send for AlertEvent
impl Sync for AlertEvent
impl Unpin for AlertEvent
impl UnsafeUnpin for AlertEvent
impl UnwindSafe for AlertEvent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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