[][src]Enum torro::torrent::TorrentFile

pub enum TorrentFile {
    Single(usize),
    MultiFile(Vec<(usize, Vec<String>)>),
}

Represents the overall torrent directory structure for a given Torrent

This merges the BEP0003 spec of either a single length for a file given or a list of dictionaries into this singular enum for easier comprehension

Documentation sourcing

All "BitTorrent Description" headings are taken from BEP0003 and is subject to change, like any moving standard. This documentation is based off of version 0e08ddf84d8d3bf101cdf897fc312f2774588c9e

Variants

Single(usize)

A single file with a usize determining it's length in bytes (1 in usize == 1 byte)

MultiFile(Vec<(usize, Vec<String>)>)

Multiple files with a similar usize to TorrentFile::Single as the first element and a Vec of String subdirectories

BitTorrent Description

length - The length of the file, in bytes.

path - A list of UTF-8 encoded strings corresponding to subdirectory names,
the last of which is the actual file name (a zero length list is an error
case).

Trait Implementations

impl Clone for TorrentFile[src]

impl Debug for TorrentFile[src]

impl PartialEq<TorrentFile> for TorrentFile[src]

impl StructuralPartialEq for TorrentFile[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.