http3-0.1.1: HTTP/3 library
Safe HaskellNone
LanguageHaskell2010

Network.QPACK.Internal

Contents

Synopsis

Documentation

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

data DynamicTable Source #

Dynamic table for QPACK.

newDynamicTableForDecoding Source #

Arguments

:: Size

The size of temporary buffer for Huffman decoding

-> (ByteString -> IO ()) 
-> IO DynamicTable 

Creating DynamicTable for decoding.

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

encodeHeader :: 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. If headers are too large, BufferOverrun is thrown.

encodeTokenHeader Source #

Arguments

:: WriteBuffer

Workspace for the body of header block

-> WriteBuffer

Workspace for encoder instructions

-> DynamicTable 
-> TokenHeaderList 
-> IO [AbsoluteIndex] 

Converting TokenHeaderList to the QPACK format. TokenHeaderList must be smaller than or equal to workspaces. Otherwise, BufferOverrun is thrown.

type EncodedEncoderInstruction = ByteString Source #

Encoded encoder instruction.

type EncodedFieldSection = ByteString Source #

Encoded field section including prefix.

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

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

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

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

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

Decoding the prefix part of header block.

encodeRequiredInsertCount :: Int -> RequiredInsertCount -> Int Source #

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

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

for decoder

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

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

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

decodeBase :: RequiredInsertCount -> 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

newtype RequiredInsertCount Source #

Constructors

RequiredInsertCount Int 

Instances

Instances details
Num RequiredInsertCount Source # 
Instance details

Defined in Network.QPACK.Types

Show RequiredInsertCount Source # 
Instance details

Defined in Network.QPACK.Types

Eq RequiredInsertCount Source # 
Instance details

Defined in Network.QPACK.Types

Ord RequiredInsertCount 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

toPreBaseIndex :: AbsoluteIndex -> BasePoint -> PreBaseIndex Source #

>>> toPreBaseIndex 96 98
PreBaseIndex 1
>>> toPreBaseIndex 97 98
PreBaseIndex 0

fromPreBaseIndex :: PreBaseIndex -> BasePoint -> AbsoluteIndex Source #

>>> fromPreBaseIndex 1 98
AbsoluteIndex 96
>>> fromPreBaseIndex 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