pub struct Torrent {
pub name: String,
pub size: u64,
pub categories: Vec<u32>,
pub link: String,
pub seeders: Option<u16>,
pub leechers: Option<u16>,
pub minimum_ratio: Option<f32>,
pub minimum_seedtime: Option<Duration>,
}Expand description
Re-exported from torrent-common
Represents a torrent in a tracker somewhere.
Fields§
§name: String§size: u64§categories: Vec<u32>§link: String§seeders: Option<u16>§leechers: Option<u16>§minimum_ratio: Option<f32>§minimum_seedtime: Option<Duration>Implementations§
Source§impl Torrent
impl Torrent
Sourcepub fn new(
name: String,
size: u64,
categories: Vec<u32>,
link: String,
seeders: Option<u16>,
leechers: Option<u16>,
minimum_ratio: Option<f32>,
minimum_seedtime: Option<Duration>,
) -> Torrent
pub fn new( name: String, size: u64, categories: Vec<u32>, link: String, seeders: Option<u16>, leechers: Option<u16>, minimum_ratio: Option<f32>, minimum_seedtime: Option<Duration>, ) -> Torrent
Constructs a new Torrent from values. If the parse-names or require-parse-names feature is enabled, will include metadata; if the require-parse-names feature is enabled, parsing is non-optional, and the function will return an error.
Trait Implementations§
impl StructuralPartialEq for Torrent
Auto Trait Implementations§
impl Freeze for Torrent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more