Skip to main content

Conceptual Introduction

Cerulion Core provides automatic serialization for message types, eliminating the need to manually write serialization code for simple structs. The serialization system supports two approaches:
  1. Automatic Copy Type Serialization: Any Copy type with #[repr(C)] layout is automatically serializable using raw byte conversion
  2. Protobuf Serialization: For cross-language compatibility and schema evolution, protobuf messages are supported via the ProtoSerializable trait
Messages are automatically serialized when sent over the network and automatically deserialized when received. The system handles relocatable-wrapped messages transparently, extracting payloads when needed.

Automatic Copy Support

Any Copy type with #[repr(C)] automatically implements SerializableMessage. No manual serialization code needed.

Protobuf Support

Optional protobuf serialization for cross-language communication and schema evolution via ProtoSerializable trait.

Relocatable Messages

Automatic handling of relocatable-wrapped messages. from_bytes() extracts payloads transparently.

Zero-Copy Local

Local communication uses zero-copy shared memory. Network communication serializes automatically.
The serialization system is designed to be transparent. You work with typed structs, and Cerulion handles the byte conversion automatically. For local communication, data is sent as raw bytes using zero-copy shared memory. For network communication, data is serialized to bytes automatically.

Key Behaviors and Guarantees

  • Automatic implementation for Copy types - Any Copy type with #[repr(C)] automatically implements SerializableMessage
  • Relocatable message support - from_bytes() automatically unwraps relocatable messages and extracts payloads
  • Type safety - Serialization validates type sizes and ensures memory safety
  • Zero-copy local transport - Local communication uses direct memory copy, no serialization overhead
  • Network serialization - Network communication automatically serializes using #[repr(C)] layout

Next Steps