delta-pack 0.3.0

Binary serialization with delta compression for real-time state synchronization
Documentation
// Auto-generated by DeltaPack - do not edit
#![allow(dead_code, unused_imports, clippy::all)]

use delta_pack::{DeltaPack, IndexMap};
use serde::{Deserialize, Serialize};

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, DeltaPack)]
pub enum HairColor {
    BLACK,
    BROWN,
    BLOND,
    RED,
    WHITE,
    OTHER,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, DeltaPack)]
pub struct Address {
    pub street: String,
    pub zip: String,
    pub state: String,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, DeltaPack)]
pub struct EmailContact {
    pub email: String,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, DeltaPack)]
pub struct PhoneContact {
    pub phone: String,
    pub extension: Option<u64>,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, DeltaPack)]
pub enum Contact {
    EmailContact(EmailContact),
    PhoneContact(PhoneContact),
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, DeltaPack)]
pub struct User {
    pub id: String,
    pub name: String,
    pub age: u64,
    pub weight: f32,
    pub married: bool,
    #[serde(rename = "hairColor")]
    pub hair_color: HairColor,
    pub address: Option<Address>,
    pub children: Vec<Box<User>>,
    pub metadata: IndexMap<String, String>,
    #[serde(rename = "preferredContact")]
    pub preferred_contact: Option<Contact>,
}