Struct orca::App
[−]
[src]
pub struct App { pub conn: Connection, }
Fields
conn: Connection
Methods
impl App
[src]
fn new(appname: &str, appversion: &str, appauthor: &str) -> Result<App, Error>
[src]
Create a new reddit instance
Arguments
appname
- Unique app nameappversion
- App versionappauthor
- Auther of the app # Returns A new reddit object
[src]
Return an Auth object for use with API calls that require a user account to work
Arguments
username
- Username of the user to be authorized aspassword
- Password of the user to be authorized asoauth
- Oauth app type # Returns A result containing either an Auth object or a certain error To use place it in the auth field of a connection struct
fn get_posts(&self, sub: &str, sort: Sort) -> Result<Value, RedditError>
[src]
Get the posts in a subreddit sorted in a specific way
Arguments
sub
- Name of subreddit to querysort
- Sort method of query # Returns A result containing a json listing of posts
fn submit_self(
&self,
sub: &str,
title: &str,
text: &str,
sendreplies: bool
) -> Result<Value, RedditError>
[src]
&self,
sub: &str,
title: &str,
text: &str,
sendreplies: bool
) -> Result<Value, RedditError>
Submit a self post
Arguments
sub
- Name of the subreddit to submit a post totitle
- Title of the posttext
- Body of the post # Returns A result with reddit's json response to the submission
fn get_self(&self) -> Result<Value, RedditError>
[src]
Get info of the user currently authorized
Note: requires connection to be authorized
Returns
A result with the json value of the user data
fn get_user(&self, name: &str) -> Result<Value, RedditError>
[src]
fn get_comments(&self, sub: &str) -> Comments
[src]
Get a iterator of all comments in order of being posted
Arguments
sub
- Name of the subreddit to pull comments from. Can be 'all' to pull from all of reddit
fn get_comment_tree(&self, post: &str) -> Result<Listing<Comment>, RedditError>
[src]
Loads the comment tree of a post, returning a listing of the Comment enum, which can be either Loaded or NotLoaded
Arguments
post
- The name of the post to retrieve the tree from
fn more_children(&self, _comment: &[&str])
[src]
Load more comments
fn comment(&self, text: &str, thing: &str)
[src]
Comment on a thing
Arguments
text
- The body of the commentthing
- Fullname of the thing to comment on
fn set_sticky(
&self,
sticky: bool,
slot: Option<i32>,
id: &str
) -> Result<(), RedditError>
[src]
&self,
sticky: bool,
slot: Option<i32>,
id: &str
) -> Result<(), RedditError>
Sticky a post in a subreddit
Arguments
sticky
- boolean value. True to set post as sticky, false to unset post as stickyslot
- Optional slot number to fill (1 or 2)id
- fullname of the post to sticky
fn load_thing<T>(&self, fullname: &str) -> Result<T, RedditError> where
T: Thing,
[src]
T: Thing,
Load a thing
fn message(
&self,
to: &str,
subject: &str,
body: &str
) -> Result<(), RedditError>
[src]
&self,
to: &str,
subject: &str,
body: &str
) -> Result<(), RedditError>