rtorrent-rpc-0.2.2.0: A library for communicating with RTorrent over its XML-RPC interface.

Copyright(c) Kai Lindholm, 2014
LicenseMIT
Maintainermegantti@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Network.RTorrent.Command.Internals

Description

 

Synopsis

Documentation

data a :*: b infixr 6 Source

A strict 2-tuple for easy combining of commands.

Constructors

(:*:) !a !b infixr 6 

Instances

(Show a, Show b) => Show ((:*:) a b) 
(NFData a, NFData b) => NFData ((:*:) a b) 
(Command a, Command b) => Command ((:*:) a b) 
type Ret ((:*:) a b) = (:*:) (Ret a) (Ret b) 

class Command a where Source

A typeclass for commands that can be send to RTorrent.

Minimal complete definition

commandCall, commandValue

Associated Types

type Ret a Source

Return type of the command.

Methods

commandCall :: a -> RTMethodCall Source

Construct a request.

commandValue :: (Applicative m, Monad m) => a -> Value -> m (Ret a) Source

Parse the resulting value.

levels :: a -> Int Source

Instances

data AnyCommand where Source

Existential wrapper for any command.

Commands wrapped in AnyCommand won't parse their results.

AnyCommand can be used when you want to call multiple commands but don't care about their return values.

Constructors

AnyCommand :: Command a => a -> AnyCommand 

newtype RTMethodCall Source

A newtype wrapper for method calls.

You shouldn't directly use the constructor if you don't know what you are doing.

Constructors

RTMethodCall Value 

Instances

mkRTMethodCall Source

Arguments

:: String

The name of the method (i.e. get_up_rate)

-> [Value]

List of parameters

-> RTMethodCall 

Make a command that should be used when defining commandCall.

parseSingle :: (Monad m, XmlRpcType a) => Value -> m a Source

Parse a value wrapped in two singleton arrays.

single :: Monad m => Value -> m Value Source

Extract a value from a singleton array.