def set_custom_serializer(self, _type, serializer):
validate_type(_type)<EOL>validate_serializer(serializer, StreamSerializer)<EOL>self._custom_serializers[_type] = serializer<EOL>
Assign a serializer for the type.

:param _type: (Type), the target type of the serializer
:param serializer: (Serializer), Custom Serializer constructor function