[−][src]Struct transmission_rs::client::Client
Interface into the major functions of Transmission including adding, and removing torrents.
The Client
does not keep track of the created torrents itself.
Example of creating a session and adding a torrent and waiting for it to complete.
use transmission::{ ClientConfig, Client}; let file_path = "./alpine.torrent"; let c = ClientConfig::new() .app_name("testing") .config_dir(config_dir) .download_dir(download_dir); let mut c = Client::new(c); let t = c.add_torrent_file(file_path).unwrap(); t.start(); // Run until done while t.stats().percent_complete < 1.0 { print!("{:#?}\r", t.stats().percent_complete); } c.close();
Implementations
impl Client
[src]
pub fn new(
host: impl ToString,
port: u16,
tls: bool,
auth: Option<(String, String)>
) -> Result<Self, Box<dyn Error>>
[src]
host: impl ToString,
port: u16,
tls: bool,
auth: Option<(String, String)>
) -> Result<Self, Box<dyn Error>>
pub async fn authenticate<'_>(&'_ mut self) -> Result<(), Box<dyn Error>>
[src]
pub fn post(&self, path: impl AsRef<str>) -> RequestBuilder
[src]
pub async fn rpc<'_>(
&'_ self,
method: impl ToString,
tag: u8,
body: impl Serialize
) -> Result<Response, Box<dyn Error>>
[src]
&'_ self,
method: impl ToString,
tag: u8,
body: impl Serialize
) -> Result<Response, Box<dyn Error>>
pub async fn list<'_>(&'_ self) -> Result<Vec<Torrent>, Box<dyn Error>>
[src]
pub async fn add_torrent_from_link<'_>(
&'_ self,
url: impl ToString
) -> Result<AddTorrentResponse, Box<dyn Error>>
[src]
&'_ self,
url: impl ToString
) -> Result<AddTorrentResponse, Box<dyn Error>>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,