Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides various helpers used by generated code; developers are not expected to invoke them directly.
These helpers are used by the low-level api. Data.Capnp.GenHelpers.Pure defines helpers used by high-level api.
Documentation
getWordField :: (ReadCtx m msg, IsWord a) => Struct msg -> Int -> Int -> Word64 -> m a Source #
fetches a field from the
struct's data section. getWordField
struct index offset defindex
is the index of the 64-bit word in the data
section in which the field resides. offset
is the offset in bits from the
start of that word to the field. def
is the default value for this field.
setWordField :: (RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) => Struct (MutMsg s) -> a -> Int -> Int -> a -> m () Source #
sets a field in the
struct's data section. The meaning of the parameters are as in
setWordField
struct value index offset defgetWordField
, with value
being the value to set. The width of the
value is inferred from its type.