[][src]Struct torq::TorrentInfo

pub struct TorrentInfo {
    pub files: Option<TorrentFiles>,
    pub length: Option<usize>,
    pub name: String,
    pub piece_length: usize,
    pub pieces: Vec<u8>,
}

Fields

files: Option<TorrentFiles>

a list of dictionaries each corresponding to a file (only when multiple files are being shared)

length: Option<usize>

size of the file in bytes (only when one file is being shared)

name: String

suggested filename where the file is to be saved (if one file) suggested directory name where the files are to be saved (if multiple files)

piece_length: usize

number of bytes per piece. This is commonly 2^8 KiB = 256 KiB = 262,144 B

pieces: Vec<u8>

i.e., a concatenation of each piece's SHA-1 hash. As SHA-1 returns a 160-bit hash, pieces will be a string whose length is a multiple of 20 bytes. If the torrent contains multiple files, the pieces are formed by concatenating the files in the order they appear in the files dictionary (i.e. all pieces in the torrent are the full piece length except for the last piece, which may be shorter).

Implementations

impl TorrentInfo[src]

Trait Implementations

impl Debug for TorrentInfo[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, 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.