pub struct Feed {
pub items: Vec<FeedItem>,
pub tags: Vec<String>,
/* private fields */
}Expand description
Representation for single feed as retrieved from database. Used for storing both url and query based feeds.
Fields§
§items: Vec<FeedItem>Article items associated with given feed.
Tags associated with given feed.
Implementations§
Source§impl Feed
impl Feed
Sourcepub fn init(url: String, title: String, feedlink: String) -> Feed
pub fn init(url: String, title: String, feedlink: String) -> Feed
Initialize new Feed using default values.
Sourcepub fn init_query_feed(title: String, line_no: usize) -> Feed
pub fn init_query_feed(title: String, line_no: usize) -> Feed
Initialize empty query feed, these feeds are composite of other feeds and filter params and are missing most of the feed parameters.
Sourcepub fn sort_items(&mut self)
pub fn sort_items(&mut self)
Sort feed items from newest to oldest.
Sourcepub fn truncated_items_count(&self) -> usize
pub fn truncated_items_count(&self) -> usize
Fetch number of items in the feed that will be held if feed is to become trunacted.
pub fn truncated_iter(&mut self) -> impl Iterator<Item = &mut FeedItem>
Sourcepub fn truncate_items(&mut self)
pub fn truncate_items(&mut self)
Compact list of articles to either 50 or week max so that we dont have to load all the articles at the same time.
Sourcepub fn update_with_url_data(
&mut self,
tags: Vec<String>,
hidden: bool,
title_override: Option<String>,
line_no: usize,
)
pub fn update_with_url_data( &mut self, tags: Vec<String>, hidden: bool, title_override: Option<String>, line_no: usize, )
Update feed with data retrieved from urls file.
Sourcepub fn display_title(&self) -> &String
pub fn display_title(&self) -> &String
User defined title (via urls file).
Sourcepub fn is_sorted(&self) -> bool
pub fn is_sorted(&self) -> bool
Whether or not feed articles have been sorted. By default articles are sorted from latest to oldest.
Whether or not feed is defined as hidden (via urls file)
Sourcepub fn is_query_feed(&self) -> bool
pub fn is_query_feed(&self) -> bool
Returns whether feed is a query feed.