Struct rawr::options::LinkPost [] [src]

pub struct LinkPost {
    pub title: String,
    pub link: String,
    pub resubmit: bool,
}

Options used when creating a link post. See structures::subreddit for examples of usage.

Fields

title

The title of the link post to create

The URL of the link to post. If this has been posted before, you must mark this as a resubmission or the API will raise an error. See LinkPost::resubmit() for an example.

resubmit

True if resubmitting this link is intended.

Methods

impl LinkPost
[src]

fn new(title: &str, link: &str) -> LinkPost

Creates a new LinkPost structure that contains the options for a link post. The post is not actually sent at this point.

fn resubmit(self) -> LinkPost

Marks this post as a resubmission, so the API will accept it even if it has been submitted in this subreddit before.

Examples

use rawr::options::LinkPost;
let post = LinkPost::new("Look at this!", "http://example.com/foo").resubmit();