massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / waitress / waitress / parser.pyi
1 from io import BytesIO
2 from typing import Any, Mapping, Pattern, Sequence
3
4 from waitress.adjustments import Adjustments
5 from waitress.receiver import ChunkedReceiver, FixedStreamReceiver
6 from waitress.utilities import Error
7
8 from .rfc7230 import HEADER_FIELD as HEADER_FIELD
9
10 class ParsingError(Exception): ...
11 class TransferEncodingNotImplemented(Exception): ...
12
13 class HTTPRequestParser:
14     completed: bool = ...
15     empty: bool = ...
16     expect_continue: bool = ...
17     headers_finished: bool = ...
18     header_plus: bytes = ...
19     chunked: bool = ...
20     content_length: int = ...
21     header_bytes_received: int = ...
22     body_bytes_received: int = ...
23     body_rcv: ChunkedReceiver | FixedStreamReceiver | None = ...
24     version: str = ...
25     error: Error | None = ...
26     connection_close: bool = ...
27     headers: Mapping[str, str] = ...
28     adj: Adjustments = ...
29     def __init__(self, adj: Adjustments) -> None: ...
30     def received(self, data: bytes) -> int: ...
31     first_line: str = ...
32     command: bytes = ...
33     url_scheme: str = ...
34     def parse_header(self, header_plus: bytes) -> None: ...
35     def get_body_stream(self) -> BytesIO: ...
36     def close(self) -> None: ...
37
38 def split_uri(uri: bytes) -> tuple[str, str, bytes, str, str]: ...
39 def get_header_lines(header: bytes) -> Sequence[bytes]: ...
40
41 first_line_re: Pattern[Any]
42
43 def crack_first_line(line: str) -> tuple[bytes, bytes, bytes]: ...