Struct torrust_index_backend::models::torrent_file::TorrentInfo
source · pub struct TorrentInfo {
pub name: String,
pub pieces: Option<ByteBuf>,
pub piece_length: i64,
pub md5sum: Option<String>,
pub length: Option<i64>,
pub files: Option<Vec<TorrentFile>>,
pub private: Option<u8>,
pub path: Option<Vec<String>>,
pub root_hash: Option<String>,
}
Fields§
§name: String
§pieces: Option<ByteBuf>
§piece_length: i64
§md5sum: Option<String>
§length: Option<i64>
§files: Option<Vec<TorrentFile>>
§private: Option<u8>
§path: Option<Vec<String>>
§root_hash: Option<String>
Implementations§
source§impl TorrentInfo
impl TorrentInfo
sourcepub fn get_pieces_as_string(&self) -> String
pub fn get_pieces_as_string(&self) -> String
torrent file can only hold a pieces key or a root hash key: BEP 39
pub fn get_root_hash_as_i64(&self) -> i64
pub fn is_a_single_file_torrent(&self) -> bool
pub fn is_a_multiple_file_torrent(&self) -> bool
Trait Implementations§
source§impl Clone for TorrentInfo
impl Clone for TorrentInfo
source§fn clone(&self) -> TorrentInfo
fn clone(&self) -> TorrentInfo
Returns a copy of the value. Read more
1.0.0 · 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
source§impl PartialEq<TorrentInfo> for TorrentInfo
impl PartialEq<TorrentInfo> for TorrentInfo
source§fn eq(&self, other: &TorrentInfo) -> bool
fn eq(&self, other: &TorrentInfo) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for TorrentInfo
impl Serialize for TorrentInfo
impl Eq for TorrentInfo
impl StructuralEq for TorrentInfo
impl StructuralPartialEq for TorrentInfo
Auto Trait Implementations§
impl RefUnwindSafe for TorrentInfo
impl Send for TorrentInfo
impl Sync for TorrentInfo
impl Unpin 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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.