Struct rarbg_api::RarBgApi[][src]

pub struct RarBgApi { /* fields omitted */ }

Implementations

impl RarBgApi[src]

pub fn app_id(&self) -> &str[src]

Return the name of your app.

Example

use rarbg_api::RarBgApi;
let api = RarBgApi::new("example").await;
assert_eq!("example", api.app_id())

pub fn token(&self) -> &Token[src]

Return the token associate to your app.

Example

use rarbg_api::RarBgApi;
use rarbg_api::token::Token;

let api = RarBgApi::new("example").await;
let token: &Token = api.token();

pub async fn new(app_id: &str) -> Self[src]

Create a new RARBG client.

Arguments

  • app_id - A string slice that holds the name of your app.

Example

use rarbg_api::RarBgApi;
let api = RarBgApi::new("example").await;

pub async fn list(
    &mut self,
    parameters: Option<&ApiParameters>
) -> Result<Torrents, Error>
[src]

List the torrents avalaible depending on parameters given.

Example

use rarbg_api::RarBgApi;
let mut api = RarBgApi::new("example").await;
// It will get the 25 last ranked torrents
let result = api.list(None).await;

pub async fn search(
    &mut self,
    value: &str,
    parameters: Option<&ApiParameters>
) -> Result<Torrents, Error>
[src]

Search torrents by its name with some or no parameters.

Example

use rarbg_api::RarBgApi;
let mut api = RarBgApi::new("example").await;
let result = api.search("Rick and Morty", None).await;

pub async fn search_by_imdb(
    &mut self,
    value: &str,
    parameters: Option<&ApiParameters>
) -> Result<Torrents, Error>
[src]

Search torrents by its IMDB id with some or no parameters.

Example

use rarbg_api::RarBgApi;
let mut api = RarBgApi::new("example").await;
// tt2861424 is Rick and Morty
let result = api.search_by_imdb("tt2861424", None).await;

pub async fn search_by_tvdb(
    &mut self,
    value: &str,
    parameters: Option<&ApiParameters>
) -> Result<Torrents, Error>
[src]

Search torrents by its TVDB id with some or no parameters.

Example

use rarbg_api::RarBgApi;
let mut api = RarBgApi::new("example").await;
// 275274 is Rick and Morty
let result = api.search_by_tvdb("275274", None).await;

pub async fn search_by_tmdb(
    &mut self,
    value: &str,
    parameters: Option<&ApiParameters>
) -> Result<Torrents, Error>
[src]

Search torrents by its TMDB id with some or no parameters.

Example

use rarbg_api::RarBgApi;
let mut api = RarBgApi::new("example").await;
// 60625 is Rick and Morty
let result = api.search_by_tmdb("60625", None).await;

Trait Implementations

impl Debug for RarBgApi[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.