pub enum Format {
Json,
Binary,
}Expand description
Serialization format options for saving and loading objects
This enum defines the available serialization formats supported by the Train Station serialization system. Each format has specific use cases and performance characteristics.
§Variants
Json- Human-readable JSON format for debugging and inspectionBinary- Efficient binary format for production deployment
§Examples
use train_station::serialization::Format;
// Check format variants
let json_format = Format::Json;
let binary_format = Format::Binary;
assert_ne!(json_format, binary_format);§Performance Considerations
- JSON: Larger file sizes, slower serialization, human-readable
- Binary: Smaller file sizes, faster serialization, machine-optimized
Variants§
Json
Human-readable JSON format
Suitable for debugging, configuration files, and cross-language interoperability. Produces larger files but allows easy inspection and modification of serialized data.
Binary
Efficient binary format
Optimized for production deployment with minimal file sizes and maximum serialization speed. Not human-readable but provides the best performance characteristics.
Trait Implementations§
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnwindSafe for Format
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more