Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Torrent
Description
BitTorrent metainfo files
Synopsis
- data Torrent = Torrent {}
- data TorrentInfo
- = SingleFile { }
- | MultiFile {
- tFiles :: [TorrentFile]
- tName :: ByteString
- tPieceLength :: Integer
- tPieces :: ByteString
- data TorrentFile = TorrentFile {
- fileLength :: Integer
- filePath :: [ByteString]
- readTorrent :: ByteString -> Either String Torrent
- serializeTorrent :: Torrent -> BEncode
- torrentSize :: Torrent -> Integer
- showTorrent :: Torrent -> ByteString
Documentation
Constructors
Torrent | |
Fields
|
Instances
Data Torrent Source # | |
Defined in Data.Torrent Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Torrent -> c Torrent Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Torrent Source # toConstr :: Torrent -> Constr Source # dataTypeOf :: Torrent -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Torrent) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Torrent) Source # gmapT :: (forall b. Data b => b -> b) -> Torrent -> Torrent Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Torrent -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Torrent -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Torrent -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Torrent -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Torrent -> m Torrent Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Torrent -> m Torrent Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Torrent -> m Torrent Source # | |
Read Torrent Source # | |
Show Torrent Source # | |
Binary Torrent Source # | |
data TorrentInfo Source #
Constructors
SingleFile | |
Fields
| |
MultiFile | |
Fields
|
Instances
Data TorrentInfo Source # | |
Defined in Data.Torrent Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TorrentInfo -> c TorrentInfo Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TorrentInfo Source # toConstr :: TorrentInfo -> Constr Source # dataTypeOf :: TorrentInfo -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TorrentInfo) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TorrentInfo) Source # gmapT :: (forall b. Data b => b -> b) -> TorrentInfo -> TorrentInfo Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TorrentInfo -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TorrentInfo -> r Source # gmapQ :: (forall d. Data d => d -> u) -> TorrentInfo -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> TorrentInfo -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TorrentInfo -> m TorrentInfo Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TorrentInfo -> m TorrentInfo Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TorrentInfo -> m TorrentInfo Source # | |
Read TorrentInfo Source # | |
Defined in Data.Torrent | |
Show TorrentInfo Source # | |
Defined in Data.Torrent |
data TorrentFile Source #
Constructors
TorrentFile | |
Fields
|
Instances
Data TorrentFile Source # | |
Defined in Data.Torrent Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TorrentFile -> c TorrentFile Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TorrentFile Source # toConstr :: TorrentFile -> Constr Source # dataTypeOf :: TorrentFile -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TorrentFile) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TorrentFile) Source # gmapT :: (forall b. Data b => b -> b) -> TorrentFile -> TorrentFile Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TorrentFile -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TorrentFile -> r Source # gmapQ :: (forall d. Data d => d -> u) -> TorrentFile -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> TorrentFile -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TorrentFile -> m TorrentFile Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TorrentFile -> m TorrentFile Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TorrentFile -> m TorrentFile Source # | |
Read TorrentFile Source # | |
Defined in Data.Torrent | |
Show TorrentFile Source # | |
Defined in Data.Torrent |
readTorrent :: ByteString -> Either String Torrent Source #
serializeTorrent :: Torrent -> BEncode Source #
torrentSize :: Torrent -> Integer Source #
Size of the files in the torrent.
showTorrent :: Torrent -> ByteString Source #
generates a torrent file
Due to lexographical ordering requirements of BEncoded data, this should generate the same ByteString that readTorrent read to generate the Torrent. However, torrent files may contain extensions and nonstandard fields that prevent that from holding for all torrent files.