Struct jsonfeed::Feed [] [src]

pub struct Feed {
    pub version: String,
    pub title: String,
    pub items: Vec<Item>,
    pub home_page_url: Option<String>,
    pub feed_url: Option<String>,
    pub description: Option<String>,
    pub user_comment: Option<String>,
    pub next_url: Option<String>,
    pub icon: Option<String>,
    pub favicon: Option<String>,
    pub author: Option<Author>,
    pub expired: Option<bool>,
    pub hubs: Option<Vec<Hub>>,
}

Represents a single feed

Examples

// Serialize a feed object to a JSON string

let feed: Feed = Feed::default();
assert_eq!(
    jsonfeed::to_string(&feed).unwrap(),
    "{\"version\":\"https://jsonfeed.org/version/1\",\"title\":\"\",\"items\":[]}"
);
// Deserialize a feed objects from a JSON String

let json = "{\"version\":\"https://jsonfeed.org/version/1\",\"title\":\"\",\"items\":[]}";
let feed: Feed = jsonfeed::from_str(&json).unwrap();
assert_eq!(
    feed,
    Feed::default()
);

Fields

Methods

impl Feed
[src]

Used to construct a Feed object

Trait Implementations

impl Debug for Feed
[src]

Formats the value using the given formatter.

impl Clone for Feed
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Feed
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for Feed
[src]

Returns the "default value" for a type. Read more