- 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
data UnmarshalError Source
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.