| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.Framing
Description
Length framing for byte strings that stand for a tuple of components: the input of a digest, or the identity of a cache key. Each component carries its own length, so no content can pass for a boundary.
Synopsis
- frameBytes :: ByteString -> Builder
- putFrame :: Scratch st -> Int -> ST st () -> ST st ()
- frameComponents :: [Maybe ByteString] -> ByteString
Documentation
frameBytes :: ByteString -> Builder Source #
One component: its decimal byte length, a colon, then its bytes.
putFrame :: Scratch st -> Int -> ST st () -> ST st () Source #
frameBytes in a scratch buffer: the byte length, a colon, then a writer of exactly that many bytes.
frameComponents :: [Maybe ByteString] -> ByteString Source #
A tuple's components in order, so that no two tuples frame to the same bytes. An absent
component is a lone -, which no length starts with, so it never frames as the shorter tuple.