Struct bip_metainfo::InfoDictionary [] [src]

pub struct InfoDictionary {
    // some fields omitted
}

Contains files and checksums for the torrent.

Methods

impl InfoDictionary
[src]

fn directory(&self) -> Option<&str>

Some file directory if this is a multi-file torrent, otherwise None.

If you want to check to see if this is a multi-file torrent, you should check whether or not this returns Some. Checking the number of files present is NOT the correct method.

fn piece_length(&self) -> i64

Length in bytes of each piece.

fn is_private(&self) -> bool

Whether or not the torrent is private.

fn pieces<'a>(&'a self) -> Pieces<'a>

Iterator over each of the pieces SHA-1 hash.

Ordering of pieces yielded in the iterator is guaranteed to be the order in which they are found in the torrent file as this is necessary to refer to pieces by their index to other peers.

fn files<'a>(&'a self) -> Files<'a>

Iterator over each file within the torrent file.

Ordering of files yielded in the iterator is guaranteed to be the order in which they are found in the torrent file as this is necessary to reconstruct pieces received from peers.

Trait Implementations

impl Debug for InfoDictionary
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.