-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Low-level D-Bus protocol implementation
--
-- Low-level D-Bus protocol implementation
@package dbus-core
@version 0.8
module DBus.UUID
data UUID
toHex :: UUID -> Text
fromHex :: Text -> Maybe UUID
instance Eq UUID
instance Show UUID
module DBus.Authentication
type Command = Text
newtype Mechanism
Mechanism :: ((Command -> IO Command) -> IO UUID) -> Mechanism
mechanismRun :: Mechanism -> (Command -> IO Command) -> IO UUID
data AuthenticationError
AuthenticationError :: Text -> AuthenticationError
authenticate :: Mechanism -> (ByteString -> IO ()) -> IO Word8 -> IO UUID
realUserID :: Mechanism
instance Typeable AuthenticationError
instance Show AuthenticationError
instance Exception AuthenticationError
module DBus.Types
data Type
DBusBoolean :: Type
DBusByte :: Type
DBusInt16 :: Type
DBusInt32 :: Type
DBusInt64 :: Type
DBusWord16 :: Type
DBusWord32 :: Type
DBusWord64 :: Type
DBusDouble :: Type
DBusString :: Type
DBusSignature :: Type
DBusObjectPath :: Type
DBusVariant :: Type
DBusArray :: Type -> Type
DBusDictionary :: Type -> Type -> Type
DBusStructure :: [Type] -> Type
-- | Every type has an associated type code; a textual representation of
-- the type, useful for debugging.
typeCode :: Type -> Text
-- | Variants may contain any other built-in D-Bus value. Besides
-- representing native VARIANT values, they allow type-safe
-- storage and deconstruction of heterogeneous collections.
data Variant
class Variable a
toVariant :: (Variable a) => a -> Variant
fromVariant :: (Variable a) => Variant -> Maybe a
-- | Every variant is strongly-typed; that is, the type of its contained
-- value is known at all times. This function retrieves that type, so
-- that the correct cast can be used to retrieve the value.
variantType :: Variant -> Type
data Signature
signatureTypes :: Signature -> [Type]
strSignature :: Signature -> Text
mkSignature :: Text -> Maybe Signature
mkSignature_ :: Text -> Signature
data ObjectPath
strObjectPath :: ObjectPath -> Text
mkObjectPath :: Text -> Maybe ObjectPath
mkObjectPath_ :: Text -> ObjectPath
data Array
-- | This is the type contained within the array, not the type of the array
-- itself.
arrayType :: Array -> Type
arrayItems :: Array -> [Variant]
toArray :: (Variable a) => Type -> [a] -> Maybe Array
fromArray :: (Variable a) => Array -> Maybe [a]
arrayFromItems :: Type -> [Variant] -> Maybe Array
arrayToBytes :: Array -> Maybe ByteString
arrayFromBytes :: ByteString -> Array
data Dictionary
dictionaryItems :: Dictionary -> [(Variant, Variant)]
dictionaryKeyType :: Dictionary -> Type
dictionaryValueType :: Dictionary -> Type
toDictionary :: (Variable a, Variable b) => Type -> Type -> Map a b -> Maybe Dictionary
fromDictionary :: (Variable a, Ord a, Variable b) => Dictionary -> Maybe (Map a b)
dictionaryFromItems :: Type -> Type -> [(Variant, Variant)] -> Maybe Dictionary
dictionaryToArray :: Dictionary -> Array
arrayToDictionary :: Array -> Maybe Dictionary
data Structure
Structure :: [Variant] -> Structure
data BusName
strBusName :: BusName -> Text
mkBusName :: Text -> Maybe BusName
mkBusName_ :: Text -> BusName
data InterfaceName
strInterfaceName :: InterfaceName -> Text
mkInterfaceName :: Text -> Maybe InterfaceName
mkInterfaceName_ :: Text -> InterfaceName
data ErrorName
strErrorName :: ErrorName -> Text
mkErrorName :: Text -> Maybe ErrorName
mkErrorName_ :: Text -> ErrorName
data MemberName
strMemberName :: MemberName -> Text
mkMemberName :: Text -> Maybe MemberName
mkMemberName_ :: Text -> MemberName
instance Typeable Structure
instance Typeable Dictionary
instance Typeable Array
instance Typeable ObjectPath
instance Typeable Signature
instance Typeable Variant
instance Eq MemberName
instance Ord MemberName
instance Eq ErrorName
instance Ord ErrorName
instance Eq InterfaceName
instance Ord InterfaceName
instance Eq BusName
instance Ord BusName
instance Show Structure
instance Eq Structure
instance Eq Dictionary
instance Eq Array
instance Eq ObjectPath
instance Ord ObjectPath
instance Eq Signature
instance Show Type
instance Eq Type
instance Variable MemberName
instance IsString MemberName
instance Show MemberName
instance Variable ErrorName
instance IsString ErrorName
instance Show ErrorName
instance Variable InterfaceName
instance IsString InterfaceName
instance Show InterfaceName
instance Variable BusName
instance IsString BusName
instance Show BusName
instance Builtin Structure
instance Variable Structure
instance Show Dictionary
instance Builtin Dictionary
instance Variable Dictionary
instance Variable ByteString
instance Variable ByteString
instance Show Array
instance Builtin Array
instance Variable Array
instance IsString ObjectPath
instance Show ObjectPath
instance Variable ObjectPath
instance Builtin ObjectPath
instance IsString Signature
instance Ord Signature
instance Show Signature
instance Variable Signature
instance Builtin Signature
instance Variable String
instance Variable Text
instance Variable Text
instance Builtin Text
instance Variable Double
instance Builtin Double
instance Variable Word64
instance Builtin Word64
instance Variable Word32
instance Builtin Word32
instance Variable Word16
instance Builtin Word16
instance Variable Int64
instance Builtin Int64
instance Variable Int32
instance Builtin Int32
instance Variable Int16
instance Builtin Int16
instance Variable Word8
instance Builtin Word8
instance Variable Bool
instance Builtin Bool
instance Variable Variant
instance Builtin Variant
instance Eq Variant
instance Show Variant
module DBus.Constants
protocolVersion :: Word8
messageMaximumLength :: Word32
arrayMaximumLength :: Word32
dbusName :: BusName
dbusPath :: ObjectPath
dbusInterface :: InterfaceName
interfaceIntrospectable :: InterfaceName
interfaceProperties :: InterfaceName
interfacePeer :: InterfaceName
errorFailed :: ErrorName
errorNoMemory :: ErrorName
errorServiceUnknown :: ErrorName
errorNameHasNoOwner :: ErrorName
errorNoReply :: ErrorName
errorIOError :: ErrorName
errorBadAddress :: ErrorName
errorNotSupported :: ErrorName
errorLimitsExceeded :: ErrorName
errorAccessDenied :: ErrorName
errorAuthFailed :: ErrorName
errorNoServer :: ErrorName
errorTimeout :: ErrorName
errorNoNetwork :: ErrorName
errorAddressInUse :: ErrorName
errorDisconnected :: ErrorName
errorInvalidArgs :: ErrorName
errorFileNotFound :: ErrorName
errorFileExists :: ErrorName
errorUnknownMethod :: ErrorName
errorTimedOut :: ErrorName
errorMatchRuleNotFound :: ErrorName
errorMatchRuleInvalid :: ErrorName
errorSpawnExecFailed :: ErrorName
errorSpawnForkFailed :: ErrorName
errorSpawnChildExited :: ErrorName
errorSpawnChildSignaled :: ErrorName
errorSpawnFailed :: ErrorName
errorSpawnFailedToSetup :: ErrorName
errorSpawnConfigInvalid :: ErrorName
errorSpawnServiceNotValid :: ErrorName
errorSpawnServiceNotFound :: ErrorName
errorSpawnPermissionsInvalid :: ErrorName
errorSpawnFileInvalid :: ErrorName
errorSpawnNoMemory :: ErrorName
errorUnixProcessIdUnknown :: ErrorName
errorInvalidFileContent :: ErrorName
errorSELinuxSecurityContextUnknown :: ErrorName
errorAdtAuditDataUnknown :: ErrorName
errorObjectPathInUse :: ErrorName
errorInconsistentMessage :: ErrorName
module DBus.Introspection
data Object
Object :: ObjectPath -> [Interface] -> [Object] -> Object
data Interface
Interface :: InterfaceName -> [Method] -> [Signal] -> [Property] -> Interface
data Method
Method :: MemberName -> [Parameter] -> [Parameter] -> Method
data Signal
Signal :: MemberName -> [Parameter] -> Signal
data Parameter
Parameter :: Text -> Signature -> Parameter
data Property
Property :: Text -> Signature -> [PropertyAccess] -> Property
data PropertyAccess
Read :: PropertyAccess
Write :: PropertyAccess
toXML :: Object -> Maybe Text
fromXML :: ObjectPath -> Text -> Maybe Object
instance Show PropertyAccess
instance Eq PropertyAccess
instance Show Property
instance Eq Property
instance Show Parameter
instance Eq Parameter
instance Show Signal
instance Eq Signal
instance Show Method
instance Eq Method
instance Show Interface
instance Eq Interface
instance Show Object
instance Eq Object
module DBus.Message
class Message a
messageFlags :: (Message a) => a -> Set Flag
messageBody :: (Message a) => a -> [Variant]
data Flag
NoReplyExpected :: Flag
NoAutoStart :: Flag
-- | A value used to uniquely identify a particular message within a
-- session. Serials are 32-bit unsigned integers, and eventually
-- wrap.
data Serial
serialValue :: Serial -> Word32
firstSerial :: Serial
nextSerial :: Serial -> Serial
data MethodCall
MethodCall :: ObjectPath -> MemberName -> Maybe InterfaceName -> Maybe BusName -> Set Flag -> [Variant] -> MethodCall
methodCallPath :: MethodCall -> ObjectPath
methodCallMember :: MethodCall -> MemberName
methodCallInterface :: MethodCall -> Maybe InterfaceName
methodCallDestination :: MethodCall -> Maybe BusName
methodCallFlags :: MethodCall -> Set Flag
methodCallBody :: MethodCall -> [Variant]
data MethodReturn
MethodReturn :: Serial -> Maybe BusName -> [Variant] -> MethodReturn
methodReturnSerial :: MethodReturn -> Serial
methodReturnDestination :: MethodReturn -> Maybe BusName
methodReturnBody :: MethodReturn -> [Variant]
data Error
Error :: ErrorName -> Serial -> Maybe BusName -> [Variant] -> Error
errorName :: Error -> ErrorName
errorSerial :: Error -> Serial
errorDestination :: Error -> Maybe BusName
errorBody :: Error -> [Variant]
errorMessage :: Error -> Text
data Signal
Signal :: ObjectPath -> MemberName -> InterfaceName -> Maybe BusName -> [Variant] -> Signal
signalPath :: Signal -> ObjectPath
signalMember :: Signal -> MemberName
signalInterface :: Signal -> InterfaceName
signalDestination :: Signal -> Maybe BusName
signalBody :: Signal -> [Variant]
data Unknown
Unknown :: Word8 -> Set Flag -> [Variant] -> Unknown
unknownType :: Unknown -> Word8
unknownFlags :: Unknown -> Set Flag
unknownBody :: Unknown -> [Variant]
-- | Not an actual message type, but a wrapper around messages received
-- from the bus. Each value contains the message's Serial and
-- possibly the origin's BusName
data ReceivedMessage
ReceivedMethodCall :: Serial -> (Maybe BusName) -> MethodCall -> ReceivedMessage
ReceivedMethodReturn :: Serial -> (Maybe BusName) -> MethodReturn -> ReceivedMessage
ReceivedError :: Serial -> (Maybe BusName) -> Error -> ReceivedMessage
ReceivedSignal :: Serial -> (Maybe BusName) -> Signal -> ReceivedMessage
ReceivedUnknown :: Serial -> (Maybe BusName) -> Unknown -> ReceivedMessage
receivedSerial :: ReceivedMessage -> Serial
receivedSender :: ReceivedMessage -> Maybe BusName
receivedBody :: ReceivedMessage -> [Variant]
module DBus.MatchRule
-- | A match rule is a set of filters; most filters may have one possible
-- value assigned, such as a single message type. The exception are
-- parameter filters, which are limited in number only by the server
-- implementation.
data MatchRule
MatchRule :: Maybe MessageType -> Maybe BusName -> Maybe InterfaceName -> Maybe MemberName -> Maybe ObjectPath -> Maybe BusName -> [ParameterValue] -> MatchRule
matchType :: MatchRule -> Maybe MessageType
matchSender :: MatchRule -> Maybe BusName
matchInterface :: MatchRule -> Maybe InterfaceName
matchMember :: MatchRule -> Maybe MemberName
matchPath :: MatchRule -> Maybe ObjectPath
matchDestination :: MatchRule -> Maybe BusName
matchParameters :: MatchRule -> [ParameterValue]
-- | The set of allowed message types to filter on is separate from the set
-- supported for sending over the wire. This allows the server to support
-- additional types not yet implemented in the library, or vice-versa.
data MessageType
MethodCall :: MessageType
MethodReturn :: MessageType
Signal :: MessageType
Error :: MessageType
-- | Parameters may match against two types, strings and object paths. It's
-- probably an error to have two values for the same parameter.
--
-- The constructor StringValue 3 "hello" means that the fourth
-- parameter in the message body must be the string "hello".
-- PathValue is the same, but its value must be an object path.
data ParameterValue
StringValue :: Word8 -> Text -> ParameterValue
PathValue :: Word8 -> ObjectPath -> ParameterValue
-- | Format a MatchRule as the bus expects to receive in a call to
-- AddMatch.
formatRule :: MatchRule -> Text
-- | Build a MethodCall for adding a match rule to the bus.
addMatch :: MatchRule -> MethodCall
-- | An empty match rule, which matches everything.
matchAll :: MatchRule
-- | Whether a ReceivedMessage matches a given rule. This is useful
-- for implementing signal handlers.
matches :: MatchRule -> ReceivedMessage -> Bool
instance Show MessageType
instance Eq MessageType
instance Show ParameterValue
instance Eq ParameterValue
instance Show MatchRule
module DBus.Wire
data Endianness
LittleEndian :: Endianness
BigEndian :: Endianness
data MarshalError
MessageTooLong :: Word64 -> MarshalError
ArrayTooLong :: Word64 -> MarshalError
InvalidBodySignature :: Text -> MarshalError
InvalidVariantSignature :: Text -> MarshalError
InvalidText :: Text -> MarshalError
data UnmarshalError
UnsupportedProtocolVersion :: Word8 -> UnmarshalError
UnexpectedEOF :: Word64 -> UnmarshalError
Invalid :: Text -> Text -> UnmarshalError
MissingHeaderField :: Text -> UnmarshalError
InvalidHeaderField :: Text -> Variant -> UnmarshalError
InvalidPadding :: Word64 -> UnmarshalError
MissingTerminator :: Word64 -> UnmarshalError
ArraySizeMismatch :: UnmarshalError
-- | Convert a Message into a ByteString. Although unusual,
-- it is possible for marshaling to fail -- if this occurs, an
-- appropriate error will be returned instead.
marshalMessage :: (Message a) => Endianness -> Serial -> a -> Either MarshalError ByteString
-- | Read bytes from a monad until a complete message has been received.
unmarshalMessage :: (Monad m) => (Word32 -> m ByteString) -> m (Either UnmarshalError ReceivedMessage)
module DBus.NameReservation
data RequestNameFlag
AllowReplacement :: RequestNameFlag
ReplaceExisting :: RequestNameFlag
DoNotQueue :: RequestNameFlag
data RequestNameReply
PrimaryOwner :: RequestNameReply
InQueue :: RequestNameReply
Exists :: RequestNameReply
AlreadyOwner :: RequestNameReply
data ReleaseNameReply
Released :: ReleaseNameReply
NonExistent :: ReleaseNameReply
NotOwner :: ReleaseNameReply
-- | Build a MethodCall for requesting a registered bus name.
requestName :: BusName -> [RequestNameFlag] -> MethodCall
-- | Build a MethodCall for releasing a registered bus name.
releaseName :: BusName -> MethodCall
mkRequestNameReply :: MethodReturn -> Maybe RequestNameReply
mkReleaseNameReply :: MethodReturn -> Maybe ReleaseNameReply
instance Show ReleaseNameReply
instance Show RequestNameReply
instance Show RequestNameFlag
module DBus.Address
data Address
addressMethod :: Address -> Text
addressParameters :: Address -> Map Text Text
mkAddresses :: Text -> Maybe [Address]
strAddress :: Address -> Text
instance Eq Address
instance Show Address
module DBus.Connection
data Connection
connectionAddress :: Connection -> Address
connectionUUID :: Connection -> UUID
data ConnectionError
InvalidAddress :: Text -> ConnectionError
BadParameters :: Address -> Text -> ConnectionError
UnknownMethod :: Address -> ConnectionError
NoWorkingAddress :: [Address] -> ConnectionError
-- | Open a connection to some address, using a given authentication
-- mechanism. If the connection fails, a ConnectionError will be
-- thrown.
connect :: Mechanism -> Address -> IO Connection
-- | Try to open a connection to various addresses, returning the first
-- connection which could be successfully opened.
connectFirst :: [(Mechanism, Address)] -> IO Connection
-- | Send a single message, with a generated Serial. The second
-- parameter exists to prevent race conditions when registering a reply
-- handler; it receives the serial the message will be sent with,
-- before it's actually sent.
--
-- Only one message may be sent at a time; if multiple threads attempt to
-- send messages in parallel, one will block until after the other has
-- finished.
send :: (Message a) => Connection -> (Serial -> IO b) -> a -> IO (Either MarshalError b)
-- | Receive the next message from the connection, blocking until one is
-- available.
--
-- Only one message may be received at a time; if multiple threads
-- attempt to receive messages in parallel, one will block until after
-- the other has finished.
receive :: Connection -> IO (Either UnmarshalError ReceivedMessage)
instance Typeable ConnectionError
instance Show ConnectionError
instance Exception ConnectionError
instance Show Connection
module DBus.Bus
-- | Similar to connect, but additionally sends Hello
-- messages to the central bus.
getBus :: Mechanism -> Address -> IO (Connection, BusName)
-- | Similar to connectFirst, but additionally sends Hello
-- messages to the central bus.
getFirstBus :: [(Mechanism, Address)] -> IO (Connection, BusName)
-- | Connect to the bus specified in the environment variable
-- DBUS_SYSTEM_BUS_ADDRESS, or to
-- unix:path=/var/run/dbus/system_bus_socket if
-- DBUS_SYSTEM_BUS_ADDRESS is not set.
getSystemBus :: IO (Connection, BusName)
-- | Connect to the bus specified in the environment variable
-- DBUS_SESSION_BUS_ADDRESS, which must be set.
getSessionBus :: IO (Connection, BusName)
-- | Connect to the bus specified in the environment variable
-- DBUS_STARTER_ADDRESS, which must be set.
getStarterBus :: IO (Connection, BusName)