Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Capnproto message canonicalization, per:
Documentation
canonicalize :: RWCtx m s => Struct 'Const -> m (Message ('Mut s), Segment ('Mut s)) Source #
Return a canonicalized message with a copy of the given struct as its root. returns a (message, segment) pair, where the segment is the first and only segment of the returned message.
In addition to the usual reasons for failure when reading a message (traversal limit, malformed messages), this can fail if the message does not fit in a single segment, as the canonical form requires single-segment messages.