GitHub

API reference for Encode.

encode(transformation): apply with .pipe.

Functions

__init__

__init__(transformation) -> None
ParameterTypeDescription
transformationTransformation[Any, Any, Any, Any]
def __init__(self, transformation: Transformation[Any, Any, Any, Any]) -> None:
    self._transformation = transformation

__call__

__call__[T, RD2 = Never, RE2 = Never](schema) -> DecodeToSchema[T, E_co, RD_co | RD2, RE_co | RE2]
ParameterTypeDescription
schemaCodec[T, E_co, RD2, RE2]

Returns DecodeToSchema[T, E_co, RD_co | RD2, RE_co | RE2]

def __call__[T, RD2 = Never, RE2 = Never](
    self, schema: Codec[T, E_co, RD2, RE2], /
) -> DecodeToSchema[T, E_co, RD_co | RD2, RE_co | RE2]:
    return _make(to_encoded(schema), schema, self._transformation)