Struct orca::net::Connection[][src]

pub struct Connection {
    pub auth: Option<OAuth>,
    pub useragent: UserAgent,
    pub client: Client<HttpsConnector<HttpConnector>, Body>,
    pub limit: Cell<LimitMethod>,
    // some fields omitted
}

A connection holder to reddit. Holds authorization info if provided, and is in charge of ratelimiting.

Fields

Authorization info (optional, but required for sending authorized requests)

User agent for the client

HTTP client

How to ratelimit (burst or steady)

Methods

impl Connection
[src]

Creates a new connection instance to reddit

Arguments

  • appname - The name of the app
  • appversion - The version of the app
  • appauthor - The author of the app (should be in reddit form as /u/)

Send a request to reddit. This is where ratelimiting happens, as well as setting the user agent.

Send a request to reddit with authorization headers

Set's the ratelimiting method

Returns a reference to the tokio core in a RefCell

Auto Trait Implementations

impl !Send for Connection

impl !Sync for Connection