pub struct NewsManager { /* private fields */ }Implementations§
Source§impl NewsManager
impl NewsManager
Sourcepub fn new(game_path: &Path, config: &LauncherConfig) -> Self
pub fn new(game_path: &Path, config: &LauncherConfig) -> Self
Create a new NewsManager, loading whatever articles are already
cached in the user-profile cache directory.
pub fn articles(&self) -> &[CachedArticle]
pub fn badge_count(&self) -> usize
pub fn is_checking(&self) -> bool
Sourcepub fn clear_badge(&mut self, config: &mut LauncherConfig)
pub fn clear_badge(&mut self, config: &mut LauncherConfig)
Mark all articles as read and persist the change to the Launcher Config.
Sourcepub fn is_check_due(&self, config: &LauncherConfig) -> bool
pub fn is_check_due(&self, config: &LauncherConfig) -> bool
Returns true if a news check is due (no check in the last 24h).
Sourcepub fn poll(&mut self) -> Option<NewsStatus>
pub fn poll(&mut self) -> Option<NewsStatus>
Poll the background thread. Returns the latest status if one arrived.
The caller is responsible for acting on NewsStatus::Success to update
LauncherConfig.news.last_check and save.
Sourcepub fn start_check(&mut self, last_read_slug: &Option<String>)
pub fn start_check(&mut self, last_read_slug: &Option<String>)
Spawn a background thread to check for new articles.
Auto Trait Implementations§
impl Freeze for NewsManager
impl RefUnwindSafe for NewsManager
impl Send for NewsManager
impl !Sync for NewsManager
impl Unpin for NewsManager
impl UnsafeUnpin for NewsManager
impl UnwindSafe for NewsManager
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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