pub struct QbitClient {
    pub host: Url,
    pub auth: Credential,
    pub client: Client,
    pub cookie_store: Arc<CookieStoreMutex>,
}

Fields§

§host: Url§auth: Credential§client: Client§cookie_store: Arc<CookieStoreMutex>

Implementations§

source§

impl QbitClient

source

pub fn new_with_user_pwd<U>( host: U, username: U, password: U ) -> Result<Self, ClientError>where U: AsRef<str>,

source

pub fn new_from_env() -> Result<Self, ClientError>

source

pub async fn _resp<E>(&self, endpoint: &E) -> Result<E::Response, ClientError>where E: Endpoint,

source

pub async fn auth_login(&self) -> Result<String, ClientError>

source

pub async fn auth_logout(&self) -> Result<String, ClientError>

source

pub async fn app_version(&self) -> Result<String, ClientError>

source

pub async fn app_webapi_version(&self) -> Result<String, ClientError>

source

pub async fn app_build_info(&self) -> Result<AppBuildInfoResponse, ClientError>

source

pub async fn app_preferences(&self) -> Result<AppPreferences, ClientError>

source

pub async fn app_set_preferences( &self, f: AppSetPreferencesForm ) -> Result<String, ClientError>

source

pub async fn app_default_save_path(&self) -> Result<String, ClientError>

source

pub async fn log_main( &self, q: LogMainQuery ) -> Result<Vec<LogMainResponseItem>, ClientError>

source

pub async fn log_peers( &self, q: LogPeersQuery ) -> Result<Vec<LogPeersResponseItem>, ClientError>

source

pub async fn sync_maindata( &self, q: SyncMaindataQuery ) -> Result<SyncMaindataResponse, ClientError>

source

pub async fn sync_torrent_peers( &self, q: SyncTorrentPeersQuery ) -> Result<SyncTorrentPeersResponse, ClientError>

source

pub async fn transfer_info(&self) -> Result<TransferInfoResponse, ClientError>

source

pub async fn speed_limits_mode( &self ) -> Result<SpeedLimitsModeResponse, ClientError>

source

pub async fn toggle_speed_limits_mode(&self) -> Result<String, ClientError>

source

pub async fn download_limit(&self) -> Result<String, ClientError>

source

pub async fn set_download_limit( &self, limit: u64 ) -> Result<String, ClientError>

source

pub async fn upload_limit(&self) -> Result<String, ClientError>

source

pub async fn set_upload_limit(&self, limit: u64) -> Result<String, ClientError>

source

pub async fn ban_peers(&self, peers: Vec<String>) -> Result<String, ClientError>

source

pub async fn torrents_info( &self, q: TorrentsInfoQuery ) -> Result<TorrentsInfoResponse, ClientError>

source

pub async fn torrents_properties( &self, hash: String ) -> Result<TorrentsPropertiesResponse, ClientError>

source

pub async fn torrents_trackers( &self, hash: String ) -> Result<TorrentsTrackersResponse, ClientError>

source

pub async fn torrents_webseeds( &self, hash: String ) -> Result<TorrentsWebseedsResponse, ClientError>

source

pub async fn torrents_files( &self, hash: String ) -> Result<TorrentsFilesResponse, ClientError>

source

pub async fn torrents_piece_states( &self, hash: String ) -> Result<TorrentsPieceStatesResponse, ClientError>

source

pub async fn torrents_piece_hashes( &self, hash: String ) -> Result<TorrentsPieceHashesResponse, ClientError>

source

pub async fn torrents_pause( &self, hashes: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_add_by_url<U>( &self, urls: &[U] ) -> Result<String, ClientError>where U: AsRef<str>,

source

pub async fn torrents_add_by_file<F>( &self, files: &[F] ) -> Result<String, ClientError>where F: AsRef<Path>,

source

pub async fn torrents_add_trackers( &self, hash: String, urls: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_edit_tracker( &self, hash: String, orig_url: String, new_url: String ) -> Result<String, ClientError>

source

pub async fn torrents_remove_trackers( &self, hash: String, urls: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_add_peers( &self, hashes: Vec<String>, peers: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_increase_prio( &self, hashes: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_decrease_prio( &self, hashes: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_top_prio( &self, hashes: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_bottom_prio( &self, hashes: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_download_limit( &self, hashes: Vec<String> ) -> Result<TorrentsDownloadLimitResponse, ClientError>

source

pub async fn torrents_set_download_limit( &self, hashes: Vec<String>, limit: u64 ) -> Result<String, ClientError>

source

pub async fn torrents_set_share_limits( &self, hashes: Vec<String>, ratio_limit: RatioLimit, seeding_time_limit: i64 ) -> Result<String, ClientError>

source

pub async fn torrents_upload_limit( &self, hashes: Vec<String> ) -> Result<TorrentsUploadLimitResponse, ClientError>

source

pub async fn torrents_set_upload_limit( &self, hashes: Vec<String>, limit: u64 ) -> Result<String, ClientError>

source

pub async fn torrents_set_location<T>( &self, hashes: Vec<String>, location: T ) -> Result<String, ClientError>where T: AsRef<Path>,

source

pub async fn torernts_rename( &self, hash: String, name: String ) -> Result<String, ClientError>

source

pub async fn torernts_set_category( &self, hashes: Vec<String>, category: String ) -> Result<String, ClientError>

source

pub async fn torrents_categories( &self ) -> Result<TorrentsCategoriesResponse, ClientError>

source

pub async fn torrents_create_category<T>( &self, category: String, save_path: T ) -> Result<String, ClientError>where T: AsRef<Path>,

source

pub async fn torrents_edit_category<T>( &self, category: String, save_path: T ) -> Result<String, ClientError>where T: AsRef<Path>,

source

pub async fn torrents_remove_categories( &self, categories: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_add_tags( &self, hashes: Vec<String>, tags: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_remove_tags( &self, hashes: Vec<String>, tags: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_tags(&self) -> Result<TorrentsTagsResponse, ClientError>

source

pub async fn torrens_create_tags( &self, tags: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_delete_tags( &self, tags: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_set_auto_management( &self, hashes: Vec<String>, enable: bool ) -> Result<String, ClientError>

source

pub async fn torrents_toggle_sequential_download( &self, hashes: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_toggle_first_last_piece_prio( &self, hashes: Vec<String> ) -> Result<String, ClientError>

source

pub async fn torrents_set_force_start( &self, hashes: Vec<String>, value: bool ) -> Result<String, ClientError>

source

pub async fn torrents_set_super_seeding( &self, hashes: Vec<String>, value: bool ) -> Result<String, ClientError>

source

pub async fn torrents_rename_file<T>( &self, hash: String, old_path: T, new_path: T ) -> Result<String, ClientError>where T: AsRef<Path>,

source

pub async fn torrents_rename_folder<T>( &self, hash: String, old_path: T, new_path: T ) -> Result<String, ClientError>where T: AsRef<Path>,

Trait Implementations§

source§

impl Debug for QbitClient

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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