Struct bip_metainfo::MetainfoBuilder
[−]
[src]
pub struct MetainfoBuilder<'a> { /* fields omitted */ }
Builder for generating a torrent file from some accessor.
Methods
impl<'a> MetainfoBuilder<'a>
[src]
fn new() -> MetainfoBuilder<'a>
Create a new MetainfoBuilder with some default values set.
fn set_main_tracker(
self,
opt_tracker_url: Option<&'a str>
) -> MetainfoBuilder<'a>
self,
opt_tracker_url: Option<&'a str>
) -> MetainfoBuilder<'a>
Set or unset the main tracker that this torrent file points to.
fn set_creation_date(self, opt_secs_epoch: Option<i64>) -> MetainfoBuilder<'a>
Set or unset the creation date for the torrent.
fn set_comment(self, opt_comment: Option<&'a str>) -> MetainfoBuilder<'a>
Set or unset a comment for the torrent file.
fn set_created_by(self, opt_created_by: Option<&'a str>) -> MetainfoBuilder<'a>
Set or unset the created by for the torrent file.
fn set_private_flag(self, opt_is_private: Option<bool>) -> MetainfoBuilder<'a>
Set or unset the private flag for the torrent file.
fn set_piece_length(self, piece_length: PieceLength) -> MetainfoBuilder<'a>
Sets the piece length for the torrent file.
fn build<A, C>(
self,
threads: usize,
accessor: A,
progress: C
) -> ParseResult<Vec<u8>> where
A: IntoAccessor,
C: FnMut(f64) + Send + 'static,
self,
threads: usize,
accessor: A,
progress: C
) -> ParseResult<Vec<u8>> where
A: IntoAccessor,
C: FnMut(f64) + Send + 'static,
Build the metainfo file from the given accessor and the number of worker threads.
Panics if threads is equal to zero.