http3-0.0.14: HTTP/3 library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.QPACK.Internal

Synopsis

Errors

Dynamic table

data DynamicTable Source #

Dynamic table for QPACK.

newDynamicTableForEncoding Source #

Arguments

:: Size

The dynamic table size

-> IO DynamicTable 

Creating DynamicTable for encoding.

newDynamicTableForDecoding Source #

Arguments

:: Size

The dynamic table size

-> Size

The size of temporary buffer for Huffman decoding

-> IO DynamicTable 

Creating DynamicTable for decoding.

Getter and setter

Entry

Reverse index

data RevResult Source #

Constructors

N 
K HIndex 
KV HIndex 

Instances

Instances details
Show RevResult Source # 
Instance details

Defined in Network.QPACK.Table.RevIndex

Eq RevResult Source # 
Instance details

Defined in Network.QPACK.Table.RevIndex

Misc

Encoder instructions

data HIndex Source #

Instances

Instances details
Show HIndex Source # 
Instance details

Defined in Network.QPACK.Types

Eq HIndex Source # 
Instance details

Defined in Network.QPACK.Types

Methods

(==) :: HIndex -> HIndex -> Bool #

(/=) :: HIndex -> HIndex -> Bool #

Ord HIndex Source # 
Instance details

Defined in Network.QPACK.Types

Decoder instructions

Encoder

encodeHeader :: EncodeStrategy -> DynamicTable -> [Header] -> IO (EncodedFieldSection, EncodedEncoderInstruction) Source #

Encoding headers with QPACK. Header block with prefix and instructions are returned. 2048, 32, and 2048 bytes-buffers are temporally allocated for header block, prefix and encoder instructions.

encodeTokenHeader Source #

Arguments

:: WriteBuffer

Workspace for the body of header block

-> WriteBuffer

Workspace for encoder instructions

-> EncodeStrategy 
-> DynamicTable 
-> TokenHeaderList 
-> IO TokenHeaderList

Leftover

Converting TokenHeaderList to the QPACK format.

type EncodedFieldSection = ByteString Source #

Encoded field section including prefix.

type EncodedEncoderInstruction = ByteString Source #

Encoded encoder instruction.

data EncodeStrategy #

Strategy for HPACK encoding.

Constructors

EncodeStrategy 

Fields

Instances

Instances details
Show EncodeStrategy 
Instance details

Defined in Network.HPACK.Types

Eq EncodeStrategy 
Instance details

Defined in Network.HPACK.Types

data CompressionAlgo #

Compression algorithms for HPACK encoding.

Constructors

Naive

No compression

Static

Using indices in the static table only

Linear

Using indices

Instances

Instances details
Show CompressionAlgo 
Instance details

Defined in Network.HPACK.Types

Eq CompressionAlgo 
Instance details

Defined in Network.HPACK.Types

encodePrefix :: WriteBuffer -> DynamicTable -> IO () Source #

Encoding the prefix part of header block. This should be used after encodeTokenHeader.

Decoder

Prefix

encodePrefix :: WriteBuffer -> DynamicTable -> IO () Source #

Encoding the prefix part of header block. This should be used after encodeTokenHeader.

decodePrefix :: ReadBuffer -> DynamicTable -> IO (InsertionPoint, BasePoint) Source #

Decoding the prefix part of header block.

encodeRequiredInsertCount :: Int -> InsertionPoint -> Int Source #

>>> encodeRequiredInsertCount 3 9
4
>>> encodeRequiredInsertCount 128 1000
233

decodeRequiredInsertCount :: Int -> InsertionPoint -> Int -> InsertionPoint Source #

for decoder

>>> decodeRequiredInsertCount 3 10 4
InsertionPoint 9
>>> decodeRequiredInsertCount 128 990 233
InsertionPoint 1000

encodeBase :: InsertionPoint -> BasePoint -> (Bool, Int) Source #

>>> encodeBase 6 9
(False,3)
>>> encodeBase 9 6
(True,2)

decodeBase :: InsertionPoint -> Bool -> Int -> BasePoint Source #

>>> decodeBase 6 False 3
BasePoint 9
>>> decodeBase 9 True 2
BasePoint 6

Types

data HIndex Source #

Instances

Instances details
Show HIndex Source # 
Instance details

Defined in Network.QPACK.Types

Eq HIndex Source # 
Instance details

Defined in Network.QPACK.Types

Methods

(==) :: HIndex -> HIndex -> Bool #

(/=) :: HIndex -> HIndex -> Bool #

Ord HIndex Source # 
Instance details

Defined in Network.QPACK.Types

toInsRelativeIndex :: AbsoluteIndex -> InsertionPoint -> InsRelativeIndex Source #

>>> toInsRelativeIndex 99 100
InsRelativeIndex 0
>>> toInsRelativeIndex 98 100
InsRelativeIndex 1
>>> toInsRelativeIndex 97 100
InsRelativeIndex 2
>>> toInsRelativeIndex 96 100
InsRelativeIndex 3

fromInsRelativeIndex :: InsRelativeIndex -> InsertionPoint -> AbsoluteIndex Source #

>>> fromInsRelativeIndex 0 100
AbsoluteIndex 99
>>> fromInsRelativeIndex 1 100
AbsoluteIndex 98
>>> fromInsRelativeIndex 2 100
AbsoluteIndex 97
>>> fromInsRelativeIndex 3 100
AbsoluteIndex 96

toHBRelativeIndex :: AbsoluteIndex -> BasePoint -> HBRelativeIndex Source #

>>> toHBRelativeIndex 96 98
HBRelativeIndex 1
>>> toHBRelativeIndex 97 98
HBRelativeIndex 0

fromHBRelativeIndex :: HBRelativeIndex -> BasePoint -> AbsoluteIndex Source #

>>> fromHBRelativeIndex 1 98
AbsoluteIndex 96
>>> fromHBRelativeIndex 0 98
AbsoluteIndex 97

toPostBaseIndex :: AbsoluteIndex -> BasePoint -> PostBaseIndex Source #

>>> toPostBaseIndex 98 98
PostBaseIndex 0
>>> toPostBaseIndex 99 98
PostBaseIndex 1

fromPostBaseIndex :: PostBaseIndex -> BasePoint -> AbsoluteIndex Source #

>>> fromPostBaseIndex 0 98
AbsoluteIndex 98
>>> fromPostBaseIndex 1 98
AbsoluteIndex 99