mirror of
https://github.com/emmett-framework/granian.git
synced 2025-08-04 17:08:02 +00:00

* Add lint and format tools and config * Format Python code * Format Rust code * Add lint CI workflow
54 lines
1.8 KiB
Python
54 lines
1.8 KiB
Python
from typing import Any, Dict, List, Optional, Tuple
|
|
|
|
from ._types import WebsocketMessage
|
|
|
|
class ASGIScope:
|
|
def as_dict(self, root_path: str) -> Dict[str, Any]: ...
|
|
|
|
class RSGIHeaders:
|
|
def __contains__(self, key: str) -> bool: ...
|
|
def keys(self) -> List[str]: ...
|
|
def values(self) -> List[str]: ...
|
|
def items(self) -> List[Tuple[str]]: ...
|
|
def get(self, key: str, default: Any = None) -> Any: ...
|
|
|
|
class RSGIScope:
|
|
proto: str
|
|
http_version: str
|
|
rsgi_version: str
|
|
server: str
|
|
client: str
|
|
scheme: str
|
|
method: str
|
|
path: str
|
|
query_string: str
|
|
|
|
@property
|
|
def headers(self) -> RSGIHeaders: ...
|
|
|
|
class RSGIHTTPStreamTransport:
|
|
async def send_bytes(self, data: bytes): ...
|
|
async def send_str(self, data: str): ...
|
|
|
|
class RSGIHTTPProtocol:
|
|
async def __call__(self) -> bytes: ...
|
|
def response_empty(self, status: int, headers: List[Tuple[str, str]]): ...
|
|
def response_str(self, status: int, headers: List[Tuple[str, str]], body: str): ...
|
|
def response_bytes(self, status: int, headers: List[Tuple[str, str]], body: bytes): ...
|
|
def response_file(self, status: int, headers: List[Tuple[str, str]], file: str): ...
|
|
def response_stream(self, status: int, headers: List[Tuple[str, str]]) -> RSGIHTTPStreamTransport: ...
|
|
|
|
class RSGIWebsocketTransport:
|
|
async def receive(self) -> WebsocketMessage: ...
|
|
async def send_bytes(self, data: bytes): ...
|
|
async def send_str(self, data: str): ...
|
|
|
|
class RSGIWebsocketProtocol:
|
|
async def accept(self) -> RSGIWebsocketTransport: ...
|
|
def close(self, status: Optional[int]) -> Tuple[int, bool]: ...
|
|
|
|
class RSGIProtocolError(RuntimeError): ...
|
|
class RSGIProtocolClosed(RuntimeError): ...
|
|
|
|
class WSGIScope:
|
|
def to_environ(self, environ: Dict[str, Any]) -> Dict[str, Any]: ...
|