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]

Create a new MetainfoBuilder with some default values set.

Set the main tracker that this torrent file points to.

Set the creation date for the torrent.

Defaults to the current time when the builder was created.

Set a comment for the torrent file.

Set the created by for the torrent file.

Sets the private flag for the torrent file.

Sets the piece length for the torrent file.

Build the metainfo file from the given accessor and the number of worker threads.

Worker threads are responsible for CPU bound tasks so if IO access is slow, increasing the number of workers may not be beneficial. This method WILL block until it completes.

Returns a list of bytes that make up the complete metainfo file.

Panics if threads is equal to zero.