middleware_encoding(f): apply with .pipe (see
MiddlewareDecoding).
Functions#
__init__#
__init__(f) -> None| Parameter | Type | Description |
|---|---|---|
f | Callable[[Parse[A, RI_contra], ParseOptions], Parse[A, R_co]] |
def __init__(self, f: Callable[[Parse[A, RI_contra], ParseOptions], Parse[A, R_co]]) -> None:
self._f = f__call__#
__call__[T, RD = Never](schema) -> Bottom[T, A, RD, R_co]| Parameter | Type | Description |
|---|---|---|
schema | Codec[T, A, RD, RI_contra] |
Returns Bottom[T, A, RD, R_co]
def __call__[T, RD = Never](
self, schema: Codec[T, A, RD, RI_contra], /
) -> Bottom[T, A, RD, R_co]:
node = schema.__codec__().ast
return Bottom(ast.decode_to(ast.to_encoded(node), node, Middleware(unchanged, self._f)))