Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides utilities for reading and writing values to and
from file Handle
s.
Synopsis
- hGetValue :: FromStruct 'Const a => Handle -> WordCount -> IO a
- getValue :: FromStruct 'Const a => WordCount -> IO a
- sGetMsg :: Socket -> WordCount -> IO (Message 'Const)
- sGetValue :: FromStruct 'Const a => Socket -> WordCount -> IO a
- hPutValue :: (Cerialize RealWorld a, ToStruct ('Mut RealWorld) (Cerial ('Mut RealWorld) a)) => Handle -> a -> IO ()
- putValue :: (Cerialize RealWorld a, ToStruct ('Mut RealWorld) (Cerial ('Mut RealWorld) a)) => a -> IO ()
- sPutValue :: (Cerialize RealWorld a, ToStruct ('Mut RealWorld) (Cerial ('Mut RealWorld) a)) => Socket -> a -> IO ()
- sPutMsg :: Socket -> Message 'Const -> IO ()
- hGetMsg :: Handle -> WordCount -> IO (Message 'Const)
- getMsg :: WordCount -> IO (Message 'Const)
- hPutMsg :: Handle -> Message 'Const -> IO ()
- putMsg :: Message 'Const -> IO ()
- hGetParsed :: forall a pa. (IsStruct a, Parse a pa) => Handle -> WordCount -> IO pa
- sGetParsed :: forall a pa. (IsStruct a, Parse a pa) => Socket -> WordCount -> IO pa
- getParsed :: (IsStruct a, Parse a pa) => WordCount -> IO pa
- hPutParsed :: (IsStruct a, Parse a pa) => Handle -> pa -> IO ()
- sPutParsed :: (IsStruct a, Parse a pa) => Socket -> pa -> IO ()
- putParsed :: (IsStruct a, Parse a pa) => pa -> IO ()
- hGetRaw :: IsStruct a => Handle -> WordCount -> IO (Raw 'Const a)
- getRaw :: IsStruct a => WordCount -> IO (Raw 'Const a)
- sGetRaw :: IsStruct a => Socket -> WordCount -> IO (Raw 'Const a)
Documentation
hGetValue :: FromStruct 'Const a => Handle -> WordCount -> IO a Source #
reads a message from hGetValue
limit handlehandle
, returning its root object.
limit
is used as both a cap on the size of a message which may be read and, for types
in the high-level API, the traversal limit when decoding the message.
It may throw a Error
if there is a problem decoding the message,
or an IOError
raised by the underlying IO libraries.
sGetMsg :: Socket -> WordCount -> IO (Message 'Const) Source #
Like hGetMsg
, except that it takes a socket instead of a Handle
.
hPutValue :: (Cerialize RealWorld a, ToStruct ('Mut RealWorld) (Cerial ('Mut RealWorld) a)) => Handle -> a -> IO () Source #
putValue :: (Cerialize RealWorld a, ToStruct ('Mut RealWorld) (Cerial ('Mut RealWorld) a)) => a -> IO () Source #
sPutValue :: (Cerialize RealWorld a, ToStruct ('Mut RealWorld) (Cerial ('Mut RealWorld) a)) => Socket -> a -> IO () Source #
hGetMsg :: Handle -> WordCount -> IO (Message 'Const) Source #
reads a message from hGetMsg
handle limithandle
that is at most
limit
64-bit words in length.
hGetParsed :: forall a pa. (IsStruct a, Parse a pa) => Handle -> WordCount -> IO pa Source #
Read a struct from the handle in its parsed form, using the supplied read limit.
sGetParsed :: forall a pa. (IsStruct a, Parse a pa) => Socket -> WordCount -> IO pa Source #
Read a struct from the socket in its parsed form, using the supplied read limit.
getParsed :: (IsStruct a, Parse a pa) => WordCount -> IO pa Source #
Read a struct from stdin in its parsed form, using the supplied read limit.
hPutParsed :: (IsStruct a, Parse a pa) => Handle -> pa -> IO () Source #
Write the parsed form of a struct to the handle
sPutParsed :: (IsStruct a, Parse a pa) => Socket -> pa -> IO () Source #
Write the parsed form of a struct to the socket.
putParsed :: (IsStruct a, Parse a pa) => pa -> IO () Source #
Write the parsed form of a struct to stdout
hGetRaw :: IsStruct a => Handle -> WordCount -> IO (Raw 'Const a) Source #
Read a struct from the handle using the supplied read limit, and return its root pointer.