# Instances of this class can be passed to `Serializer::serialize`
interface Serializable
# Serialize `self` to `serializer`
#
# This is a shortcut to `Serializer::serialize`.
fun serialize_to(serializer: Serializer) do serializer.serialize(self)
# Actual serialization of `self` to `serializer`
#
# This writes the full data of `self` to `serializer`.
#
# This method can be redefined in sub classes and refinements.
# It should use `Serializer::serialize_attribute` to to register real or
# logical attributes.
#
# Any refinement should have its equivalent refinement of
# `Deserializer::deserialize_class` to support this custom deserialization.
fun core_serialize_to(serializer: Serializer) do end
# Accept references or force direct serialization (using `serialize_to`)
#
# The subclass change the default behavior, which will accept references,
# to force to always serialize copies of `self`.
private fun serialize_to_or_delay(v: Serializer) do v.serialize_reference(self)
# Create an instance of this class from the `deserializer`
#
# This constructor is refined by subclasses to correctly build their instances.
init from_deserializer(deserializer: Deserializer) is nosuper do end
end
lib/serialization/serialization_core.nit:219,1--248,3