pub struct ArticleStore { /* private fields */ }Implementations§
Source§impl ArticleStore
impl ArticleStore
Source§impl ArticleStore
impl ArticleStore
pub fn new(feeds: Vec<FeedEntry>, config: Config, data_dir: PathBuf) -> Self
pub fn with_client( feeds: Vec<FeedEntry>, config: Config, data_dir: PathBuf, client: Client, ) -> Self
pub fn feeds(&self) -> &[FeedEntry]
pub fn config(&self) -> &Config
pub fn cache(&self) -> &CacheStore
pub fn data_dir(&self) -> &Path
pub fn client(&self) -> &Client
Sourcepub fn set_articles(&mut self, articles: Vec<Article>)
pub fn set_articles(&mut self, articles: Vec<Article>)
Replace internal articles (used in tests and for direct manipulation).
pub fn take_articles(&mut self) -> Vec<Article>
Sourcepub fn mark_read(&mut self, index: usize)
pub fn mark_read(&mut self, index: usize)
Mark an article as read by index (internal state + cache).
Sourcepub fn toggle_read(&mut self, index: usize) -> bool
pub fn toggle_read(&mut self, index: usize) -> bool
Toggle read status of an article by index. Returns the new read state.
Sourcepub fn query(&self, params: &FilterParams) -> Vec<usize>
pub fn query(&self, params: &FilterParams) -> Vec<usize>
Return indices of filtered articles. Does not modify internal state.
Sourcepub fn query_articles(&self, params: &FilterParams) -> Vec<Article>
pub fn query_articles(&self, params: &FilterParams) -> Vec<Article>
Return cloned articles matching the filter (for CLI display compatibility).
Auto Trait Implementations§
impl Freeze for ArticleStore
impl !RefUnwindSafe for ArticleStore
impl Send for ArticleStore
impl Sync for ArticleStore
impl Unpin for ArticleStore
impl UnsafeUnpin for ArticleStore
impl !UnwindSafe for ArticleStore
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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