[][src]Struct transmission::torrent::torrent::Torrent

pub struct Torrent { /* fields omitted */ }

Representation of a torrent download.

Can be used to start, stop, or get the information of a torrent.

Methods

impl<'a> Torrent[src]

pub fn parse_torrent_file(path: &str) -> TrResult<TorrentInfo>[src]

pub fn build() -> TorrentBuilder[src]

Alias to TorrentBuilder::new()

pub fn start(&self)[src]

Start or resume the torrent

pub fn stop(&self)[src]

Stop (pause) the torrent

pub fn remove(self, with_data: bool)[src]

Removes a torrent from the downloads Consumes the Torrent

pub fn verify(&self)[src]

Verify the torrent

pub fn name(&self) -> &str[src]

This torrent's name

pub fn id(&self) -> i32[src]

The unique ID of the torrent

pub fn stats(&self) -> TorrentStats[src]

The stats of the torrent as given by Transmission

These are only available after the torrent has been added to a session

pub fn info(&self) -> TorrentInfo[src]

The info of the torrent as given by Transmission

This is available after the torrent has been parsed and does not need to be added to a session.

pub fn set_ratio(&mut self, limit: f64)[src]

Set the seed ratio of the torrent

pub fn set_download_dir(&mut self, download_dir: PathBuf)[src]

Set the download directory of the torrent

pub fn set_priority(&mut self, priority: Priority)[src]

Set the priority of the torrent

See Priority for more information

pub fn get_file_index(&self, file: &TorrentFile) -> Option<usize>[src]

File Related Functions

Get the index of a file in a torrent

pub fn set_file_download(&mut self, file: TorrentFile, download: bool)[src]

pub fn set_files_download(&mut self, files: Vec<TorrentFile>, download: bool)[src]

Set whether or not a set of files should be downloaded

pub fn set_files_download_by_id(&mut self, ids: Vec<u32>, download: bool)[src]

Set whether or not a set of files, by ids, should be downloaded

pub fn set_file_priority(&mut self, file: TorrentFile, priority: Priority)[src]

pub fn set_files_priorities(
    &mut self,
    files: Vec<TorrentFile>,
    priority: Priority
)
[src]

Set the priority of a set of files

pub fn set_files_priorities_by_id(&mut self, ids: Vec<u32>, priority: Priority)[src]

Set the priority of a set of files, by ids

Trait Implementations

impl AsMut<Torrent> for Torrent[src]

impl Sync for Torrent[src]

impl Clone for Torrent[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Send for Torrent[src]

impl Serialize for Torrent[src]

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.