pub struct QbitClient {
pub host: Url,
pub auth: Credential,
pub client: Client,
pub cookie_store: Arc<CookieStoreMutex>,
}
Fields§
§host: Url
§auth: Credential
§client: Client
Implementations§
Source§impl QbitClient
impl QbitClient
pub fn new_with_user_pwd<U>( host: U, username: U, password: U, ) -> Result<Self, ClientError>
pub fn new_from_env() -> Result<Self, ClientError>
pub async fn _resp<E>(&self, endpoint: &E) -> Result<E::Response, ClientError>where
E: Endpoint,
Sourcepub async fn auth_login(&self) -> Result<(), ClientError>
pub async fn auth_login(&self) -> Result<(), ClientError>
§/api/v2/auth/login
Sourcepub async fn auth_logout(&self) -> Result<(), ClientError>
pub async fn auth_logout(&self) -> Result<(), ClientError>
§/api/v2/auth/logout
Sourcepub async fn app_version(&self) -> Result<String, ClientError>
pub async fn app_version(&self) -> Result<String, ClientError>
§/api/v2/app/version
Sourcepub async fn app_webapi_version(&self) -> Result<String, ClientError>
pub async fn app_webapi_version(&self) -> Result<String, ClientError>
§/api/v2/app/webapiVersion
Sourcepub async fn app_build_info(&self) -> Result<BuildInfoResponse, ClientError>
pub async fn app_build_info(&self) -> Result<BuildInfoResponse, ClientError>
§/api/v2/app/buildInfo
Sourcepub async fn app_shutdown(&self) -> Result<(), ClientError>
pub async fn app_shutdown(&self) -> Result<(), ClientError>
§/api/v2/app/shutdown
Sourcepub async fn app_preferences(&self) -> Result<Preferences, ClientError>
pub async fn app_preferences(&self) -> Result<Preferences, ClientError>
§/api/v2/app/preferences
Sourcepub async fn app_set_preferences(
&self,
f: &SetPreferencesForm,
) -> Result<(), ClientError>
pub async fn app_set_preferences( &self, f: &SetPreferencesForm, ) -> Result<(), ClientError>
§/api/v2/app/setPreferences
Sourcepub async fn app_default_save_path(&self) -> Result<(), ClientError>
pub async fn app_default_save_path(&self) -> Result<(), ClientError>
§/api/v2/app/defaultSavePath
Sourcepub async fn log_main(
&self,
q: &MainQuery,
) -> Result<Vec<MainResponseItem>, ClientError>
pub async fn log_main( &self, q: &MainQuery, ) -> Result<Vec<MainResponseItem>, ClientError>
§/api/v2/log/main
Sourcepub async fn log_peers(
&self,
q: &PeersQuery,
) -> Result<Vec<PeersResponseItem>, ClientError>
pub async fn log_peers( &self, q: &PeersQuery, ) -> Result<Vec<PeersResponseItem>, ClientError>
§/api/v2/log/peers
Sourcepub async fn sync_maindata(
&self,
q: &MaindataQuery,
) -> Result<MaindataResponse, ClientError>
pub async fn sync_maindata( &self, q: &MaindataQuery, ) -> Result<MaindataResponse, ClientError>
§/api/v2/sync/maindata
Sourcepub async fn sync_torrent_peers(
&self,
q: &TorrentPeersQuery,
) -> Result<TorrentPeersResponse, ClientError>
pub async fn sync_torrent_peers( &self, q: &TorrentPeersQuery, ) -> Result<TorrentPeersResponse, ClientError>
§/api/v2/sync/torrentPeers
Sourcepub async fn transfer_info(&self) -> Result<InfoResponse, ClientError>
pub async fn transfer_info(&self) -> Result<InfoResponse, ClientError>
§/api/v2/transfer/info
Sourcepub async fn speed_limits_mode(
&self,
) -> Result<SpeedLimitsModeResponse, ClientError>
pub async fn speed_limits_mode( &self, ) -> Result<SpeedLimitsModeResponse, ClientError>
§/api/v2/transfer/speedLimitsMode
Sourcepub async fn toggle_speed_limits_mode(&self) -> Result<(), ClientError>
pub async fn toggle_speed_limits_mode(&self) -> Result<(), ClientError>
§/api/v2/transfer/toggleSpeedLimitsMode
Sourcepub async fn download_limit(&self) -> Result<u64, ClientError>
pub async fn download_limit(&self) -> Result<u64, ClientError>
§/api/v2/transfer/downloadLimit
Sourcepub async fn set_download_limit(&self, limit: u64) -> Result<(), ClientError>
pub async fn set_download_limit(&self, limit: u64) -> Result<(), ClientError>
§/api/v2/transfer/setDownloadLimit
Sourcepub async fn upload_limit(&self) -> Result<u64, ClientError>
pub async fn upload_limit(&self) -> Result<u64, ClientError>
§/api/v2/transfer/uploadLimit
Sourcepub async fn set_upload_limit(&self, limit: u64) -> Result<(), ClientError>
pub async fn set_upload_limit(&self, limit: u64) -> Result<(), ClientError>
§/api/v2/transfer/setUploadLimit
Sourcepub async fn ban_peers<T>(&self, peers: &[T]) -> Result<(), ClientError>
pub async fn ban_peers<T>(&self, peers: &[T]) -> Result<(), ClientError>
§/api/v2/transfer/banPeers
Sourcepub async fn torrents_info(
&self,
q: &InfoQuery,
) -> Result<InfoResponse, ClientError>
pub async fn torrents_info( &self, q: &InfoQuery, ) -> Result<InfoResponse, ClientError>
§/api/v2/torrents/info
Sourcepub async fn torrents_properties(
&self,
hash: &str,
) -> Result<PropertiesResponse, ClientError>
pub async fn torrents_properties( &self, hash: &str, ) -> Result<PropertiesResponse, ClientError>
§/api/v2/torrents/properties
Sourcepub async fn torrents_trackers(
&self,
hash: &str,
) -> Result<TrackersResponse, ClientError>
pub async fn torrents_trackers( &self, hash: &str, ) -> Result<TrackersResponse, ClientError>
§/api/v2/torrents/trackers
Sourcepub async fn torrents_webseeds(
&self,
hash: &str,
) -> Result<WebseedsResponse, ClientError>
pub async fn torrents_webseeds( &self, hash: &str, ) -> Result<WebseedsResponse, ClientError>
§/api/v2/torrents/webseeds
Sourcepub async fn torrents_files(
&self,
hash: &str,
indexes: Option<&[u64]>,
) -> Result<FilesResponse, ClientError>
pub async fn torrents_files( &self, hash: &str, indexes: Option<&[u64]>, ) -> Result<FilesResponse, ClientError>
§/api/v2/torrents/files
Sourcepub async fn torrents_piece_states(
&self,
hash: &str,
) -> Result<PieceStatesResponse, ClientError>
pub async fn torrents_piece_states( &self, hash: &str, ) -> Result<PieceStatesResponse, ClientError>
§/api/v2/torrents/pieceStates
Sourcepub async fn torrents_piece_hashes(
&self,
hash: &str,
) -> Result<PieceHashesResponse, ClientError>
pub async fn torrents_piece_hashes( &self, hash: &str, ) -> Result<PieceHashesResponse, ClientError>
§/api/v2/torrents/pieceHashes
Sourcepub async fn torrents_pause<T>(&self, hashes: &[T]) -> Result<(), ClientError>
pub async fn torrents_pause<T>(&self, hashes: &[T]) -> Result<(), ClientError>
§/api/v2/torrents/pause
Sourcepub async fn torrents_resume<T>(&self, hashes: &[T]) -> Result<(), ClientError>
pub async fn torrents_resume<T>(&self, hashes: &[T]) -> Result<(), ClientError>
§/api/v2/torrents/resume
Sourcepub async fn torrents_delete<T>(
&self,
hashes: &[T],
delete_files: bool,
) -> Result<(), ClientError>
pub async fn torrents_delete<T>( &self, hashes: &[T], delete_files: bool, ) -> Result<(), ClientError>
§/api/v2/torrents/delete
Sourcepub async fn torrents_recheck<H>(&self, hashes: &[H]) -> Result<(), ClientError>
pub async fn torrents_recheck<H>(&self, hashes: &[H]) -> Result<(), ClientError>
§/api/v2/torrents/recheck
Sourcepub async fn torrents_reannounce<H>(
&self,
hashes: &[H],
) -> Result<(), ClientError>
pub async fn torrents_reannounce<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
§/api/v2/torrents/reannounce
Sourcepub async fn torrents_add_by_url<U>(
&self,
urls: &[U],
) -> Result<(), ClientError>
pub async fn torrents_add_by_url<U>( &self, urls: &[U], ) -> Result<(), ClientError>
§/api/v2/torrents/add
Sourcepub async fn torrents_add_by_file<F>(
&self,
files: &[F],
) -> Result<(), ClientError>
pub async fn torrents_add_by_file<F>( &self, files: &[F], ) -> Result<(), ClientError>
§/api/v2/torrents/add
Sourcepub async fn torrents_add_trackers<H, U>(
&self,
hash: H,
urls: &[U],
) -> Result<(), ClientError>
pub async fn torrents_add_trackers<H, U>( &self, hash: H, urls: &[U], ) -> Result<(), ClientError>
§/api/v2/torrents/addTrackers
Sourcepub async fn torrents_edit_tracker<H, U>(
&self,
hash: H,
orig_url: U,
new_url: U,
) -> Result<(), ClientError>
pub async fn torrents_edit_tracker<H, U>( &self, hash: H, orig_url: U, new_url: U, ) -> Result<(), ClientError>
§/api/v2/torrents/editTracker
Sourcepub async fn torrents_remove_trackers<H, U>(
&self,
hash: H,
urls: &[U],
) -> Result<(), ClientError>
pub async fn torrents_remove_trackers<H, U>( &self, hash: H, urls: &[U], ) -> Result<(), ClientError>
§/api/v2/torrents/removeTrackers
Sourcepub async fn torrents_add_peers<H, P>(
&self,
hashes: &[H],
peers: &[P],
) -> Result<(), ClientError>
pub async fn torrents_add_peers<H, P>( &self, hashes: &[H], peers: &[P], ) -> Result<(), ClientError>
§/api/v2/torrents/addPeers
Sourcepub async fn torrents_increase_prio<H>(
&self,
hashes: &[H],
) -> Result<(), ClientError>
pub async fn torrents_increase_prio<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
§/api/v2/torrents/increasePrio
Sourcepub async fn torrents_decrease_prio<H>(
&self,
hashes: &[H],
) -> Result<(), ClientError>
pub async fn torrents_decrease_prio<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
§/api/v2/torrents/decreasePrio
Sourcepub async fn torrents_top_prio<H>(
&self,
hashes: &[H],
) -> Result<(), ClientError>
pub async fn torrents_top_prio<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
§/api/v2/torrents/topPrio
Sourcepub async fn torrents_bottom_prio<H>(
&self,
hashes: &[H],
) -> Result<(), ClientError>
pub async fn torrents_bottom_prio<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
§/api/v2/torrents/bottomPrio
Sourcepub async fn torrents_download_limit<H>(
&self,
hashes: &[H],
) -> Result<DownloadLimitResponse, ClientError>
pub async fn torrents_download_limit<H>( &self, hashes: &[H], ) -> Result<DownloadLimitResponse, ClientError>
Sourcepub async fn torrents_set_download_limit<H>(
&self,
hashes: &[H],
limit: u64,
) -> Result<(), ClientError>
pub async fn torrents_set_download_limit<H>( &self, hashes: &[H], limit: u64, ) -> Result<(), ClientError>
§/api/v2/torrents/setDownloadLimit
§/api/v2/torrents/setShareLimits
Sourcepub async fn torrents_upload_limit<H>(
&self,
hashes: &[H],
) -> Result<UploadLimitResponse, ClientError>
pub async fn torrents_upload_limit<H>( &self, hashes: &[H], ) -> Result<UploadLimitResponse, ClientError>
§/api/v2/torrents/uploadLimit
Sourcepub async fn torrents_set_upload_limit<H>(
&self,
hashes: &[H],
limit: u64,
) -> Result<(), ClientError>
pub async fn torrents_set_upload_limit<H>( &self, hashes: &[H], limit: u64, ) -> Result<(), ClientError>
§/api/v2/torrents/setUploadLimit
Sourcepub async fn torrents_set_location<H, L>(
&self,
hashes: &[H],
location: L,
) -> Result<(), ClientError>
pub async fn torrents_set_location<H, L>( &self, hashes: &[H], location: L, ) -> Result<(), ClientError>
§/api/v2/torrents/setLocation
Sourcepub async fn torernts_rename<H, N>(
&self,
hash: H,
name: N,
) -> Result<(), ClientError>
pub async fn torernts_rename<H, N>( &self, hash: H, name: N, ) -> Result<(), ClientError>
§/api/v2/torrents/rename
Sourcepub async fn torernts_set_category<H, C>(
&self,
hashes: &[H],
category: C,
) -> Result<(), ClientError>
pub async fn torernts_set_category<H, C>( &self, hashes: &[H], category: C, ) -> Result<(), ClientError>
§/api/v2/torrents/setCategory
Sourcepub async fn torrents_categories(
&self,
) -> Result<CategoriesResponse, ClientError>
pub async fn torrents_categories( &self, ) -> Result<CategoriesResponse, ClientError>
§/api/v2/torrents/categories
Sourcepub async fn torrents_create_category<C, P>(
&self,
category: C,
save_path: P,
) -> Result<(), ClientError>
pub async fn torrents_create_category<C, P>( &self, category: C, save_path: P, ) -> Result<(), ClientError>
§/api/v2/torrents/createCategory
Sourcepub async fn torrents_edit_category<C, P>(
&self,
category: C,
save_path: P,
) -> Result<(), ClientError>
pub async fn torrents_edit_category<C, P>( &self, category: C, save_path: P, ) -> Result<(), ClientError>
§/api/v2/torrents/editCategory
Sourcepub async fn torrents_remove_categories<C>(
&self,
categories: &[C],
) -> Result<(), ClientError>
pub async fn torrents_remove_categories<C>( &self, categories: &[C], ) -> Result<(), ClientError>
§/api/v2/torrents/removeCategories
§/api/v2/torrents/addTags
§/api/v2/torrents/removeTags
§/api/v2/torrents/tags
§/api/v2/torrents/createTags
§/api/v2/torrents/deleteTags
Sourcepub async fn torrents_set_auto_management<H>(
&self,
hashes: &[H],
enable: bool,
) -> Result<(), ClientError>
pub async fn torrents_set_auto_management<H>( &self, hashes: &[H], enable: bool, ) -> Result<(), ClientError>
§/api/v2/torrents/setAutoManagement
Sourcepub async fn torrents_toggle_sequential_download<H>(
&self,
hashes: &[H],
) -> Result<(), ClientError>
pub async fn torrents_toggle_sequential_download<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
§/api/v2/torrents/toggleSequentialDownload
Sourcepub async fn torrents_toggle_first_last_piece_prio<H>(
&self,
hashes: &[H],
) -> Result<(), ClientError>
pub async fn torrents_toggle_first_last_piece_prio<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
§/api/v2/torrents/toggleFirstLastPiecePrio
Sourcepub async fn torrents_set_force_start<H>(
&self,
hashes: &[H],
value: bool,
) -> Result<(), ClientError>
pub async fn torrents_set_force_start<H>( &self, hashes: &[H], value: bool, ) -> Result<(), ClientError>
§/api/v2/torrents/setForceStart
Sourcepub async fn torrents_set_super_seeding<H>(
&self,
hashes: &[H],
value: bool,
) -> Result<(), ClientError>
pub async fn torrents_set_super_seeding<H>( &self, hashes: &[H], value: bool, ) -> Result<(), ClientError>
§/api/v2/torrents/setSuperSeeding
Sourcepub async fn torrents_rename_file<H, P>(
&self,
hash: H,
old_path: P,
new_path: P,
) -> Result<(), ClientError>
pub async fn torrents_rename_file<H, P>( &self, hash: H, old_path: P, new_path: P, ) -> Result<(), ClientError>
§/api/v2/torrents/renameFile
Sourcepub async fn torrents_rename_folder<H, P>(
&self,
hash: H,
old_path: P,
new_path: P,
) -> Result<(), ClientError>
pub async fn torrents_rename_folder<H, P>( &self, hash: H, old_path: P, new_path: P, ) -> Result<(), ClientError>
§/api/v2/torrents/renameFolder
Sourcepub async fn search_start<T>(
&self,
pattern: T,
plugins: T,
category: T,
) -> Result<StartResponse, ClientError>
pub async fn search_start<T>( &self, pattern: T, plugins: T, category: T, ) -> Result<StartResponse, ClientError>
§/api/v2/search/start
Sourcepub async fn search_stop(&self, id: u64) -> Result<(), ClientError>
pub async fn search_stop(&self, id: u64) -> Result<(), ClientError>
§/api/v2/search/stop
Sourcepub async fn search_status(
&self,
id: Option<u64>,
) -> Result<StatusResponse, ClientError>
pub async fn search_status( &self, id: Option<u64>, ) -> Result<StatusResponse, ClientError>
§/api/v2/search/status
Sourcepub async fn search_results(
&self,
id: u64,
limit: Option<i64>,
offset: Option<i64>,
) -> Result<ResultsResponse, ClientError>
pub async fn search_results( &self, id: u64, limit: Option<i64>, offset: Option<i64>, ) -> Result<ResultsResponse, ClientError>
§/api/v2/search/results
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QbitClient
impl !RefUnwindSafe for QbitClient
impl Send for QbitClient
impl Sync for QbitClient
impl Unpin for QbitClient
impl !UnwindSafe for QbitClient
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