Struct Api

Source
pub struct Api { /* private fields */ }
Expand description

Main handle and access point to working with qbittorrent

Full documentation on provided methods is available here here

Implementations§

Source§

impl Api

Source

pub async fn new( username: &str, password: &str, address: &str, ) -> Result<Self, Error>

Source

pub async fn application_version(&self) -> Result<String, Error>

Source

pub async fn api_version(&self) -> Result<String, Error>

Source

pub async fn build_info(&self) -> Result<BuildInfo, Error>

Source

pub async fn shutdown(&self) -> Result<(), Error>

Source

pub async fn default_save_path(&self) -> Result<String, Error>

Source

pub async fn get_log(&self, log_request: &LogRequest) -> Result<Vec<Log>, Error>

Source

pub async fn get_global_transfer_info( &self, ) -> Result<GlobalTransferInfo, Error>

Source

pub async fn get_alternate_speed_limits_state( &self, ) -> Result<AlternateLimits, Error>

Source

pub async fn toggle_alternative_speed_limits(&self) -> Result<(), Error>

Source

pub async fn get_torrent_list(&self) -> Result<Vec<Torrent>, Error>

Source

pub async fn add_new_torrent(&self, data: &TorrentDownload) -> Result<(), Error>

Source

pub async fn get_all_categories( &self, ) -> Result<BTreeMap<String, Categories>, Error>

list all categories that currently exist

Source

pub async fn add_category(&self, name: &str, path: &str) -> Result<(), Error>

Trait Implementations§

Source§

impl Category<Api> for Torrent

Source§

fn set_category<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, api: &'life1 Api, category: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

impl Debug for Api

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Pause<Api> for Hash

Source§

fn pause<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl Pause<Api> for Torrent

Source§

fn pause<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl Pause<Api> for Vec<Hash>

Source§

fn pause<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl Recheck<Api> for Hash

Source§

fn recheck<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl Recheck<Api> for Torrent

Source§

fn recheck<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl Resume<Api> for Hash

Source§

fn resume<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl Resume<Api> for Torrent

Source§

fn resume<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl Resume<Api> for Vec<Hash>

Source§

fn resume<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl Tags<Api, [String]> for Hash

Source§

fn add_tag<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, api: &'life1 Api, tags: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

impl Tags<Api, [String]> for Torrent

Source§

fn add_tag<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, api: &'life1 Api, tags: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

impl TorrentData<Api> for Hash

Source§

fn properties<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<TorrentProperties, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn trackers<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<Vec<Tracker>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn contents<'a, 'async_trait>( &'a self, api: &'a Api, ) -> Pin<Box<dyn Future<Output = Result<Vec<TorrentInfo<'a>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Source§

impl TorrentData<Api> for Torrent

Source§

fn properties<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<TorrentProperties, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn trackers<'life0, 'life1, 'async_trait>( &'life0 self, api: &'life1 Api, ) -> Pin<Box<dyn Future<Output = Result<Vec<Tracker>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn contents<'a, 'async_trait>( &'a self, api: &'a Api, ) -> Pin<Box<dyn Future<Output = Result<Vec<TorrentInfo<'a>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Source§

impl TorrentData<Torrent> for Api

Source§

fn properties<'life0, 'life1, 'async_trait>( &'life0 self, torrent: &'life1 Torrent, ) -> Pin<Box<dyn Future<Output = Result<TorrentProperties, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn trackers<'life0, 'life1, 'async_trait>( &'life0 self, torrent: &'life1 Torrent, ) -> Pin<Box<dyn Future<Output = Result<Vec<Tracker>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn contents<'a, 'async_trait>( &'a self, torrent: &'a Torrent, ) -> Pin<Box<dyn Future<Output = Result<Vec<TorrentInfo<'a>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Auto Trait Implementations§

§

impl Freeze for Api

§

impl !RefUnwindSafe for Api

§

impl Send for Api

§

impl Sync for Api

§

impl Unpin for Api

§

impl !UnwindSafe for Api

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T