tf-types 0.1.6

Core semantic types, traits, and schemas powering the TrustForge protocol.
Documentation
// GENERATED by `tf-schema codegen --target rust` — DO NOT EDIT BY HAND.

#![allow(unused_imports, non_camel_case_types, non_snake_case, clippy::all)]

use serde::{Deserialize, Serialize};
use super::*;

/// Signed record describing a TrustForge session being moved between transports while preserving session_id, generation, and trust continuity (TF-0003 "session migration").
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct SessionMigration {
    /// Version of the session-migration schema itself.
    pub migration_version: SessionMigration_MigrationVersion,
    /// The session id that survives the migration. Must equal the pre-migration session id.
    pub session_id: String,
    /// Migration counter. Increases by 1 per migration; lets receivers detect replays.
    pub generation: i64,
    pub from_binding: TransportBinding,
    pub to_binding: TransportBinding,
    /// Capabilities the migration explicitly preserves.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub preserved_capabilities: Option<Vec<Capability>>,
    /// Whether the session keys were rotated as part of the migration.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub rotated_keys: Option<bool>,
    pub migrated_at: Timestamp,
    /// Human-readable reason (transport upgrade, network change, peer reconnect, ...).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub reason: Option<String>,
    pub signer: ActorId,
    pub signature: SignatureEnvelope,
}

/// Version of the session-migration schema itself.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum SessionMigration_MigrationVersion {
    #[serde(rename = "1")]
    V1,
}