Struct rarbg_api::RarBgApi [−][src]
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]
&mut self,
parameters: Option<&ApiParameters>
) -> Result<Torrents, Error>
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]
&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; 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]
&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; 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]
&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; 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]
&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; let mut api = RarBgApi::new("example").await; // 60625 is Rick and Morty let result = api.search_by_tmdb("60625", None).await;
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for RarBgApi
[src]
impl Send for RarBgApi
[src]
impl Sync for RarBgApi
[src]
impl Unpin for RarBgApi
[src]
impl UnwindSafe for RarBgApi
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,