DBus.Wire
- data Endianness
- data MarshalError
- data UnmarshalError
- marshalMessage :: Message a => Endianness -> Serial -> a -> Either MarshalError ByteString
- unmarshalMessage :: Monad m => (Word32 -> m ByteString) -> m (Either UnmarshalError ReceivedMessage)
Documentation
data MarshalError Source
Constructors
| MessageTooLong Word64 | |
| ArrayTooLong Word64 | |
| InvalidBodySignature Text | |
| InvalidVariantSignature Text | |
| InvalidText Text |
Instances
data UnmarshalError Source
Constructors
| UnsupportedProtocolVersion Word8 | |
| UnexpectedEOF Word64 | |
| Invalid Text Text | |
| MissingHeaderField Text | |
| InvalidHeaderField Text Variant | |
| InvalidPadding Word64 | |
| MissingTerminator Word64 | |
| ArraySizeMismatch |
Instances
marshalMessage :: Message a => Endianness -> Serial -> a -> Either MarshalError ByteStringSource
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.
unmarshalMessage :: Monad m => (Word32 -> m ByteString) -> m (Either UnmarshalError ReceivedMessage)Source
Read bytes from a monad until a complete message has been received.