capnp-0.17.0.0: Cap'n Proto for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Capnp.IO

Description

This module provides utilities for reading and writing values to and from file Handles.

Synopsis

Documentation

sGetMsg :: Socket -> WordCount -> IO (Message 'Const) Source #

Like hGetMsg, except that it takes a socket instead of a Handle.

sPutMsg :: Socket -> Message 'Const -> IO () Source #

Like hPutMsg, except that it takes a Socket instead of a Handle.

hGetMsg :: Handle -> WordCount -> IO (Message 'Const) Source #

hGetMsg handle limit reads a message from handle that is at most limit 64-bit words in length.

hPutMsg :: Handle -> Message 'Const -> IO () Source #

hPutMsg handle msg writes msg to handle. If there is an exception, it will be an IOError raised by the underlying IO libraries.

putMsg :: Message 'Const -> IO () Source #

Equivalent to hPutMsg stdout

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 a 'Const) Source #

Read a struct from the handle using the supplied read limit, and return its root pointer.

getRaw :: IsStruct a => WordCount -> IO (Raw a 'Const) Source #

Read a struct from stdin using the supplied read limit, and return its root pointer.

sGetRaw :: IsStruct a => Socket -> WordCount -> IO (Raw a 'Const) Source #

Read a struct from the socket using the supplied read limit, and return its root pointer.