pub struct TorrentInfo {
pub info_hash: String,
pub magnet_link: String,
pub name: String,
pub total_size: u64,
pub files: Vec<FileInfo>,
pub piece_length: u64,
pub peers: Vec<String>,
pub timestamp: u64,
}Expand description
Validated torrent metadata delivered to the application callback.
Fields§
§info_hash: StringLowercase hexadecimal SHA1 of the bencoded info dictionary.
magnet_link: StringMagnet URI containing the InfoHash.
name: StringTorrent display name.
total_size: u64Sum of file sizes in bytes.
files: Vec<FileInfo>Files described by the torrent.
piece_length: u64Torrent piece length in bytes, or zero if absent.
peers: Vec<String>Peer addresses used to obtain the Metadata.
timestamp: u64Completion time as Unix seconds.
Implementations§
Source§impl TorrentInfo
impl TorrentInfo
Sourcepub fn format_size(&self) -> String
pub fn format_size(&self) -> String
Formats Self::total_size using binary thresholds and a short unit suffix.
Trait Implementations§
Source§impl Clone for TorrentInfo
impl Clone for TorrentInfo
Source§fn clone(&self) -> TorrentInfo
fn clone(&self) -> TorrentInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TorrentInfo
impl Debug for TorrentInfo
Source§impl<'de> Deserialize<'de> for TorrentInfo
impl<'de> Deserialize<'de> for TorrentInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TorrentInfo
impl RefUnwindSafe for TorrentInfo
impl Send for TorrentInfo
impl Sync for TorrentInfo
impl Unpin for TorrentInfo
impl UnsafeUnpin for TorrentInfo
impl UnwindSafe for TorrentInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more