Enum bip_disk::IDiskMessage
[−]
[src]
pub enum IDiskMessage { AddTorrent(MetainfoFile), RemoveTorrent(InfoHash), SyncTorrent(InfoHash), LoadBlock(BlockMut), ProcessBlock(Block), }
Messages that can be sent to the DiskManager
.
Variants
AddTorrent(MetainfoFile)
Message to add a torrent to the disk manager.
RemoveTorrent(InfoHash)
Message to remove a torrent from the disk manager.
Note, this will NOT remove any data from the FileSystem
,
and as an added convenience, this message will also trigger
a IDiskMessage::SyncTorrent
message.
SyncTorrent(InfoHash)
Message to tell the FileSystem
to sync the torrent.
This message will trigger a call to FileSystem::sync
for every
file in the torrent, so the semantics will differ depending on the
FileSystem
in use.
In general, if a torrent has finished downloading, but will be kept
in the DiskManager
to, for example, seed the torrent, then this
message should be sent, otherwise, IDiskMessage::RemoveTorrent
is
sufficient.
LoadBlock(BlockMut)
Message to load the given block in to memory.
ProcessBlock(Block)
Message to process the given block and persist it.