pub fn list<P: AsRef<Path>>(
file: P,
tags: Option<Vec<String>>,
date: Option<Date>,
) -> Result<Feed>
Expand description
Read and return the feed stored in a protobuf file.
§Behavior
Calls read_feed
on the provided path and returns the parsed Feed
. If tags and/or
date filters are provided it filters the resulting Feed
.
§Arguments
file
: Path to the.pb
feed file.
§Returns
The parsed Feed
on success.
§Errors
Any error bubbled up from read_feed
, e.g. I/O errors (file missing,
permissions), or decode errors if the file is not a valid feed.
§Example
use std::path::PathBuf;
use linkleaf_core::*;
let path = PathBuf::from("mylinks.pb");
let feed = list(&path, None, None)?;
println!("Title: {}, links: {}", feed.title, feed.links.len());
Ok::<(), anyhow::Error>(())