| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Capnp.IO
Description
This module provides utilities for reading and writing values to and
from file Handles.
Synopsis
- hGetValue :: FromStruct ConstMsg a => Handle -> WordCount -> IO a
- getValue :: FromStruct ConstMsg a => WordCount -> IO a
- sGetMsg :: Socket -> WordCount -> IO ConstMsg
- sGetValue :: FromStruct ConstMsg a => Socket -> WordCount -> IO a
- hPutValue :: (Cerialize a, ToStruct (MutMsg RealWorld) (Cerial (MutMsg RealWorld) a)) => Handle -> a -> IO ()
- putValue :: (Cerialize a, ToStruct (MutMsg RealWorld) (Cerial (MutMsg RealWorld) a)) => a -> IO ()
- sPutValue :: (Cerialize a, ToStruct (MutMsg RealWorld) (Cerial (MutMsg RealWorld) a)) => Socket -> a -> IO ()
- sPutMsg :: Socket -> ConstMsg -> IO ()
- hGetMsg :: Handle -> WordCount -> IO ConstMsg
- getMsg :: WordCount -> IO ConstMsg
- hPutMsg :: Handle -> ConstMsg -> IO ()
- putMsg :: ConstMsg -> IO ()
Documentation
hGetValue :: FromStruct ConstMsg 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 ConstMsg Source #
Like hGetMsg, except that it takes a socket instead of a Handle.
hPutValue :: (Cerialize a, ToStruct (MutMsg RealWorld) (Cerial (MutMsg RealWorld) a)) => Handle -> a -> IO () Source #
putValue :: (Cerialize a, ToStruct (MutMsg RealWorld) (Cerial (MutMsg RealWorld) a)) => a -> IO () Source #
sPutValue :: (Cerialize a, ToStruct (MutMsg RealWorld) (Cerial (MutMsg RealWorld) a)) => Socket -> a -> IO () Source #
hGetMsg :: Handle -> WordCount -> IO ConstMsg Source #
reads a message from hGetMsg handle limithandle that is at most
limit 64-bit words in length.