pub struct RarBgApi { /* private fields */ }
Implementations§
Source§impl RarBgApi
impl RarBgApi
Sourcepub fn app_id(&self) -> &str
pub fn app_id(&self) -> &str
Return the name of your app.
§Example
use rarbg_api::RarBgApi;
#[tokio::main]
async fn main() {
let api = RarBgApi::new("RustExample").await;
let app_id = api.app_id();
}
Sourcepub fn token(&self) -> &Token
pub fn token(&self) -> &Token
Return the token associate to your app.
§Example
use rarbg_api::RarBgApi;
use rarbg_api::token::Token;
#[tokio::main]
async fn main() {
let api = RarBgApi::new("RustExample").await;
let token: &Token = api.token();
}
Sourcepub async fn list(
&mut self,
parameters: Option<&ApiParameters>,
) -> Result<Torrents, Error>
pub async fn list( &mut self, parameters: Option<&ApiParameters>, ) -> Result<Torrents, Error>
List the torrents available depending on parameters given.
§Example
use rarbg_api::RarBgApi;
use rarbg_api::token::Token;
#[tokio::main]
async fn main() {
let mut api = RarBgApi::new("RustExample").await;
// It will get the 25 last ranked torrents
let result = api.list(None).await;
}
Sourcepub async fn search(
&mut self,
value: &str,
parameters: Option<&ApiParameters>,
) -> Result<Torrents, Error>
pub async fn search( &mut self, value: &str, parameters: Option<&ApiParameters>, ) -> Result<Torrents, Error>
Search torrents by its name with some or no parameters.
§Example
use rarbg_api::RarBgApi;
use rarbg_api::token::Token;
#[tokio::main]
async fn main() {
let mut api = RarBgApi::new("RustExample").await;
let result = api.search("Rick and Morty", None).await;
}
Sourcepub async fn search_by_imdb(
&mut self,
value: &str,
parameters: Option<&ApiParameters>,
) -> Result<Torrents, Error>
pub async fn search_by_imdb( &mut self, value: &str, parameters: Option<&ApiParameters>, ) -> Result<Torrents, Error>
Search torrents by its IMDB id with some or no parameters.
§Example
use rarbg_api::RarBgApi;
use rarbg_api::token::Token;
#[tokio::main]
async fn main() {
let mut api = RarBgApi::new("RustExample").await;
// tt2861424 is Rick and Morty
let result = api.search_by_imdb("tt2861424", None).await;
}
Sourcepub async fn search_by_tvdb(
&mut self,
value: &str,
parameters: Option<&ApiParameters>,
) -> Result<Torrents, Error>
pub async fn search_by_tvdb( &mut self, value: &str, parameters: Option<&ApiParameters>, ) -> Result<Torrents, Error>
Search torrents by its TVDB id with some or no parameters.
§Example
use rarbg_api::RarBgApi;
use rarbg_api::token::Token;
#[tokio::main]
async fn main() {
let mut api = RarBgApi::new("RustExample").await;
// 275274 is Rick and Morty
let result = api.search_by_tvdb("275274", None).await;
}
Sourcepub async fn search_by_tmdb(
&mut self,
value: &str,
parameters: Option<&ApiParameters>,
) -> Result<Torrents, Error>
pub async fn search_by_tmdb( &mut self, value: &str, parameters: Option<&ApiParameters>, ) -> Result<Torrents, Error>
Search torrents by its TMDB id with some or no parameters.
§Example
use rarbg_api::RarBgApi;
use rarbg_api::token::Token;
#[tokio::main]
async fn main() {
let mut api = RarBgApi::new("RustExample").await;
// 60625 is Rick and Morty
let result = api.search_by_tmdb("60625", None).await;
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RarBgApi
impl RefUnwindSafe for RarBgApi
impl Send for RarBgApi
impl Sync for RarBgApi
impl Unpin for RarBgApi
impl UnwindSafe for RarBgApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more