effusion v0.2.0 Effusion.BTP.Pieces View Source

Functions for assembling the file that results from a torrent download.

Link to this section Summary

Functions

Add a block of data to torrent.

Check if the torrent has cached or written all of the pieces it needs to be complete.

Returns true if all pieces of this torrent have been written to disk.

Get the bitfield value representing the torrent's finished pieces.

Get the number of bytes that have been added to this torrent.

Get the number of bytes still necessary for this download to be finished.

Create a map that describes a torrent download.

Get the set of blocks cached by this torrent.

Link to this section Functions

Link to this function

add_block(torrent, block)

View Source

Add a block of data to torrent.

If the addition of the block finishes a piece, the piece will then be verified and moved to the :pieces set.

Check if the torrent has cached or written all of the pieces it needs to be complete.

Returns true if all pieces of this torrent have been written to disk.

Get the bitfield value representing the torrent's finished pieces.

This bitfield includes both in-memory as well as on-disk pieces.

Link to this function

bytes_completed(info_hash)

View Source

Get the number of bytes that have been added to this torrent.

This includes bytes in blocks that have not yet been verified.

Get the number of bytes still necessary for this download to be finished.

Link to this function

has_block?(info_hash, block)

View Source
Link to this function

has_piece?(info_hash, index)

View Source
Link to this function

has_pieces?(info_hash, bits)

View Source
Link to this function

mark_piece_written(torrent, i)

View Source

Create a map that describes a torrent download.

Link to this function

torrent_length(info_hash)

View Source

Get the set of blocks cached by this torrent.