Pkt_line.DecoderModule for decoding Git pkt lines, as specified at https://github.com/git/git/blob/master/Documentation/technical/protocol-common.txt
In the docs, we define min_pkt_len = 4 as in specs.
val create : unit -> decoderval decoder_from : string -> decoderval end_of_input : decoder -> intval pp_error : error Fmt.tleave_with d error raises Leave { error; buffer = d.buffer; committed = d.pos }
safe k decoder wraps a call k decoder in a try-with block; if exception Leave err is raised, the function returns Error of err
val peek_char : decoder -> char optionval string : string -> decoder -> unitval junk_char : decoder -> unitval while1 : (char -> bool) -> decoder -> bytes * int * intval at_least_one_pkt : decoder -> boolreturns true if decoder.max - decoder.pos is >= min_pkt_len and >= pkt_len, where pkt_len is the length of a pkt line starting at decoder.pos.
val at_least_one_line : decoder -> boolval peek_while_eol : decoder -> bytes * int * intval peek_while_eol_or_space : decoder -> bytes * int * intval peek_pkt : decoder -> bytes * int * intval junk_pkt : decoder -> unitincrease decoder.pos by max min_pkt_len pkt_len, where pkt_len is the length of the pkt line starting at the current value of decoder.pos (before increasing) and min_pkt_len = 4.