pub struct NewsPanel { /* private fields */ }Expand description
News or highlights fed by the host’s Datafeed::news.
Keep it on the chart’s symbol with set_symbol; the user switches between
that symbol’s stories and the whole market’s. With set_symbols they can
add symbols, and with set_topics and
set_providers narrow the stories by topic and provider; offering the
values again keeps the choices still offered. Each change asks the feed again with the
complete selection, and only the answer to the latest request is shown. A story opens to its text, with actions to show the chart at its time and to open its
link. Call poll each frame, then
show while the panel is open.
Implementations§
Source§impl NewsPanel
impl NewsPanel
Sourcepub fn highlights() -> Self
pub fn highlights() -> Self
A highlights panel without a feed: summaries shown under their headlines.
Sourcepub fn set_feed(&mut self, feed: Arc<dyn Datafeed>)
pub fn set_feed(&mut self, feed: Arc<dyn Datafeed>)
Ask feed for stories from now on, starting at once.
Sourcepub fn set_symbol(&mut self, symbol: &str)
pub fn set_symbol(&mut self, symbol: &str)
Follow symbol, such as the chart’s. A new symbol asks again while its stories are shown.
Sourcepub fn set_symbols(&mut self, symbols: impl IntoIterator<Item = String>)
pub fn set_symbols(&mut self, symbols: impl IntoIterator<Item = String>)
Offer symbols as further symbols to show stories about, next to the followed one. None is
selected at first; choices still offered stay selected.
Sourcepub fn set_topics(&mut self, topics: impl IntoIterator<Item = String>)
pub fn set_topics(&mut self, topics: impl IntoIterator<Item = String>)
Offer topics, in the values the feed supports, as a filter. None is selected at first,
which lists every topic; choices still offered stay selected.
Sourcepub fn set_providers(&mut self, providers: impl IntoIterator<Item = String>)
pub fn set_providers(&mut self, providers: impl IntoIterator<Item = String>)
Offer providers, in the identifiers the feed uses, as a filter. None is selected at
first, which lists every provider; choices still offered stay selected.
Sourcepub fn poll(&mut self, ctx: &Context)
pub fn poll(&mut self, ctx: &Context)
Receive the feed’s answer and wake the UI when the next one arrives.
Sourcepub fn show(&mut self, ui: &mut Ui) -> NewsAction
pub fn show(&mut self, ui: &mut Ui) -> NewsAction
Render the stories, or the open story, after poll.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for NewsPanel
impl !UnwindSafe for NewsPanel
impl Freeze for NewsPanel
impl Send for NewsPanel
impl Sync for NewsPanel
impl Unpin for NewsPanel
impl UnsafeUnpin for NewsPanel
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