faust.types.serializers

class faust.types.serializers.RegistryT(key_serializer: Optional[Union[CodecT, str]] = None, value_serializer: Optional[Union[CodecT, str]] = 'json')[source]
key_serializer: Optional[Union[CodecT, str]]
value_serializer: Optional[Union[CodecT, str]]
abstract loads_key(typ: Optional[_ModelArg], key: Optional[bytes], *, serializer: Optional[Union[CodecT, str]] = None) Optional[Union[bytes, _ModelT, Any]][source]
Return type:

_UnionGenericAlias[bytes, _ModelT, Any, None]

abstract loads_value(typ: Optional[_ModelArg], value: Optional[bytes], *, serializer: Optional[Union[CodecT, str]] = None) Any[source]
Return type:

Any

abstract dumps_key(typ: Optional[_ModelArg], key: Optional[Union[bytes, _ModelT, Any]], *, serializer: Optional[Union[CodecT, str]] = None) Optional[bytes][source]
Return type:

_UnionGenericAlias[bytes, None]

abstract dumps_value(typ: Optional[_ModelArg], value: Union[bytes, _ModelT, Any], *, serializer: Optional[Union[CodecT, str]] = None) Optional[bytes][source]
Return type:

_UnionGenericAlias[bytes, None]

class faust.types.serializers.SchemaT(*, key_type: Optional[_ModelArg] = None, value_type: Optional[_ModelArg] = None, key_serializer: Optional[Union[CodecT, str]] = None, value_serializer: Optional[Union[CodecT, str]] = None, allow_empty: Optional[bool] = None)[source]
key_type: Optional[_ModelArg] = None
value_type: Optional[_ModelArg] = None
key_serializer: Optional[Union[CodecT, str]] = None
value_serializer: Optional[Union[CodecT, str]] = None
allow_empty: bool = False
abstract update(*, key_type: Optional[_ModelArg] = None, value_type: Optional[_ModelArg] = None, key_serializer: Optional[Union[CodecT, str]] = None, value_serializer: Optional[Union[CodecT, str]] = None, allow_empty: Optional[bool] = None) None[source]
Return type:

None

abstract loads_key(app: _AppT, message: _Message, *, loads: Optional[Callable] = None, serializer: Optional[Union[CodecT, str]] = None) KT[source]
Return type:

~KT

abstract loads_value(app: _AppT, message: _Message, *, loads: Optional[Callable] = None, serializer: Optional[Union[CodecT, str]] = None) VT[source]
Return type:

~VT

abstract dumps_key(app: _AppT, key: Optional[Union[bytes, _ModelT, Any]], *, serializer: Optional[Union[CodecT, str]] = None, headers: Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]) Tuple[Any, Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]][source]
Return type:

_GenericAlias[Any, _UnionGenericAlias[_GenericAlias[_GenericAlias[str, bytes]], _GenericAlias[str, bytes], None]]

abstract dumps_value(app: _AppT, value: Union[bytes, _ModelT, Any], *, serializer: Optional[Union[CodecT, str]] = None, headers: Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]) Tuple[Any, Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]][source]
Return type:

_GenericAlias[Any, _UnionGenericAlias[_GenericAlias[_GenericAlias[str, bytes]], _GenericAlias[str, bytes], None]]

abstract on_dumps_key_prepare_headers(key: Union[bytes, _ModelT, Any], headers: Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]) Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]][source]
Return type:

_UnionGenericAlias[_GenericAlias[_GenericAlias[str, bytes]], _GenericAlias[str, bytes], None]

abstract on_dumps_value_prepare_headers(value: Union[bytes, _ModelT, Any], headers: Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]) Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]][source]
Return type:

_UnionGenericAlias[_GenericAlias[_GenericAlias[str, bytes]], _GenericAlias[str, bytes], None]