[−][src]Struct torq::TorrentInfo
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]
pub fn parse(dict: &BencodeHashMap) -> TorrentInfo
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TorrentInfo
[src]
impl Send for TorrentInfo
[src]
impl Sync for TorrentInfo
[src]
impl Unpin for TorrentInfo
[src]
impl UnwindSafe for TorrentInfo
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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>,