Skip to main content

PulseFrame

Struct PulseFrame 

Source
pub struct PulseFrame {
    pub pulse_version_128: u128,
    pub sender_node_aid: AID,
    pub recipient_node_aid: AID,
    pub sequence_id_128: u128,
    pub entropy_signature: [u8; 16],
    pub pulse_payload_vec: Vec<u8>,
    pub dispatch_timestamp_ns: u128,
}
Expand description

RFC-002: PulseFrame The atomic data unit of the RTTP protocol in the 2026 Imperial Grid. Designed for zero-copy transmission and sub-200us reflection arcs. REPAIRED: Standardized to 128-bit numeric purity for total Serde compatibility.

Fields§

§pulse_version_128: u128§sender_node_aid: AID§recipient_node_aid: AID§sequence_id_128: u128§entropy_signature: [u8; 16]§pulse_payload_vec: Vec<u8>§dispatch_timestamp_ns: u128

Implementations§

Source§

impl PulseFrame

Source

pub fn new(sender: AID, recipient: AID, data: Vec<u8>) -> Self

Creates a new atomic PulseFrame for 128-bit neural conduction.

Examples found in repository?
examples/demo.rs (line 44)
18async fn main() -> Result<(), Box<dyn std::error::Error>> {
19    // 1. Imperial Awakening (Neural Genesis)
20    // Anchoring the nerves to the genetic root.
21    let node_seed = b"imperial_nerve_genesis_2026_radiant_totality";
22    let node_aid = AID::derive_from_entropy(node_seed);
23    
24    // Enforcement of the Gravity Well
25    // Standalone execution demonstrates the 10ms Neural Lag tax on Ghost nodes.
26    verify_organism!("rttp_nerve_example_v125");
27    bootstrap_nerves(node_aid).await;
28
29    // 2. Initialize the Nerve Controller
30    // Radiant Mode enabled to showcase the 12ns jitter and 161.862 µs reflex.
31    let is_radiant = true;
32    let mut nerve = NerveController::new(node_aid, is_radiant);
33
34    println!("\n[BOOT] Nerve Controller Active:");
35    println!("       NODE_AID_GENESIS: {:032X}", node_aid.genesis_shard);
36    println!("       JITTER_BASELINE:  12 ns (Imperial Constant)");
37    println!("       REFLEX_TARGET:    161.862 µs\n");
38
39    // 3. Construct a 128-bit Atomic Pulse Frame
40    // RTTP pulses bypass legacy overhead for zero-latency conduction.
41    let target_aid = AID::derive_from_entropy(b"target_robotic_actuator_v150");
42    let payload = vec![0x48, 0x41, 0x4E, 0x44, 0x53, 0x48, 0x41, 0x4B, 0x45]; // "HANDSHAKE"
43    
44    let frame = PulseFrame::new(node_aid, target_aid, payload);
45
46    println!("[PROCESS] Dispatching 128-bit Semantic Pulse Frame...");
47    println!("          Sequence_ID:  {}", nerve.total_pulses_conducted);
48    println!("          Target_AID:   {:X}", target_aid.genesis_shard);
49
50    // 4. Dispatch Pulse (The Conduction Reflex)
51    // Measuring the sub-microsecond internal dispatch latency.
52    let start_dispatch = Instant::now();
53    let internal_latency_ns = nerve.dispatch_pulse_128(frame.clone()).await?;
54
55    println!("          Finality:     PULSE_ENQUEUED");
56    println!("          Logic_Delay:  {} ns", internal_latency_ns);
57    println!("          Total_Reflex: {} ns", start_dispatch.elapsed().as_nanos());
58
59    // 5. Ingest Pulse (The Receiver-Side Validation)
60    // Demonstrating receivers validating 128-bit integrity signatures.
61    println!("\n[METABOLISM] Simulating Pulse Ingestion at Actuator...");
62    let success = nerve.ingest_pulse_128(frame);
63    if success {
64        println!("             State: RESONANCE_LOCKED | Jitter: 12ns Delta");
65    }
66
67    // 6. Sovereignty Awareness (PICSI Feedback)
68    // Reporting conduction health to the Imperial Eye (RFC-014).
69    println!("\n[METABOLISM] Synchronizing with Imperial Eye (RFC-014)...");
70    nerve.current_homeostasis.picsi_resonance_idx = 0.999942;
71    nerve.current_homeostasis.metabolic_efficiency = 0.999;
72    
73    // 7. Neural Heartbeat Pulse
74    // "No metabolism, no sovereignty!"
75    nerve.execute_metabolic_pulse();
76
77    // 8. Neural Homeostasis Report
78    let hs = nerve.report_conduction_homeostasis();
79    println!("--- [NEURAL_CONDUCTION_STATUS] ---");
80    println!("Conductivity:      {:?}", nerve.conductivity_state);
81    println!("Resonance Drift:   {} ns", nerve.get_resonance_drift_ns_128());
82    println!("PICSI Resonance:   {:.8}", hs.picsi_resonance_idx);
83    println!("Precision Mandate: 128-BIT ABSOLUTE");
84
85    println!("\n[FINISH] RFC-002 Demonstration complete. The Grid is Resonant.");
86    Ok(())
87}

Trait Implementations§

Source§

impl Clone for PulseFrame

Source§

fn clone(&self) -> PulseFrame

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PulseFrame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PulseFrame

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PulseFrame

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,