Coverage for src / lexigram / contracts / web / middleware / protocols.py: 0%
6 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-15 18:57 +0800
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-15 18:57 +0800
1"""Web middleware protocols for request/response processing guards."""
3from __future__ import annotations
5from typing import Any, Protocol, runtime_checkable
8@runtime_checkable
9class ASGIMiddlewareProtocol(Protocol):
10 """Protocol for ASGI-compatible middleware components.
12 Implements the ASGI callable interface so middleware can be
13 wrapped around any ASGI application.
14 """
16 async def __call__(
17 self,
18 scope: dict[str, Any],
19 receive: Any,
20 send: Any,
21 ) -> None:
22 """Handle an ASGI request.
24 Args:
25 scope: ASGI connection scope.
26 receive: ASGI receive callable.
27 send: ASGI send callable.
28 """
29 ...
32__all__ = ["ASGIMiddlewareProtocol"]