Serialize data structures.