Struct torrust_index_backend::models::torrent_file::Torrent
source · pub struct Torrent {
pub info: TorrentInfo,
pub announce: Option<String>,
pub nodes: Option<Vec<TorrentNode>>,
pub encoding: Option<String>,
pub httpseeds: Option<Vec<String>>,
pub announce_list: Option<Vec<Vec<String>>>,
pub creation_date: Option<i64>,
pub comment: Option<String>,
pub created_by: Option<String>,
}
Fields§
§info: TorrentInfo
§announce: Option<String>
§nodes: Option<Vec<TorrentNode>>
§encoding: Option<String>
§httpseeds: Option<Vec<String>>
§announce_list: Option<Vec<Vec<String>>>
§creation_date: Option<i64>
§comment: Option<String>
§created_by: Option<String>
Implementations§
source§impl Torrent
impl Torrent
pub fn from_db_info_files_and_announce_urls( torrent_info: DbTorrentInfo, torrent_files: Vec<TorrentFile>, torrent_announce_urls: Vec<Vec<String>> ) -> Self
sourcepub async fn set_announce_urls(&mut self, cfg: &Configuration)
pub async fn set_announce_urls(&mut self, cfg: &Configuration)
Sets the announce url to the tracker url and removes all other trackers if the torrent is private.
pub fn calculate_info_hash_as_bytes(&self) -> [u8; 20]
pub fn info_hash(&self) -> String
pub fn file_size(&self) -> i64
pub fn announce_urls(&self) -> Vec<String>
pub fn is_a_single_file_torrent(&self) -> bool
pub fn is_a_multiple_file_torrent(&self) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for Torrent
impl<'de> Deserialize<'de> for Torrent
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
source§impl PartialEq<Torrent> for Torrent
impl PartialEq<Torrent> for Torrent
impl StructuralPartialEq for Torrent
Auto Trait Implementations§
impl RefUnwindSafe for Torrent
impl Send for Torrent
impl Sync for Torrent
impl Unpin for Torrent
impl UnwindSafe for Torrent
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