Skip to main content

NodeStateExt

Trait NodeStateExt 

Source
pub trait NodeStateExt {
Show 17 methods // Required methods fn new(position: (f64, f64, f64)) -> Self; fn update_timestamp(&mut self); fn get_position(&self) -> (f64, f64, f64); fn update_position(&mut self, position: (f64, f64, f64)); fn get_health(&self) -> HealthStatus; fn update_health(&mut self, health: HealthStatus); fn get_phase(&self) -> Phase; fn update_phase(&mut self, phase: Phase); fn assign_cell(&mut self, cell_id: String); fn leave_cell(&mut self); fn assign_zone(&mut self, zone_id: String); fn leave_zone(&mut self); fn consume_fuel(&mut self, minutes: u32); fn replenish_fuel(&mut self, minutes: u32); fn is_operational(&self) -> bool; fn needs_refuel(&self) -> bool; fn merge(&mut self, other: &NodeState);
}

Required Methods§

Source

fn new(position: (f64, f64, f64)) -> Self

Create a new node state at a given position

Source

fn update_timestamp(&mut self)

Update the timestamp to current time

Source

fn get_position(&self) -> (f64, f64, f64)

Get position as tuple (lat, lon, alt)

Source

fn update_position(&mut self, position: (f64, f64, f64))

Update position (LWW-Register operation)

Source

fn get_health(&self) -> HealthStatus

Get health status

Source

fn update_health(&mut self, health: HealthStatus)

Update health status (LWW-Register operation)

Source

fn get_phase(&self) -> Phase

Get phase

Source

fn update_phase(&mut self, phase: Phase)

Update phase (LWW-Register operation)

Source

fn assign_cell(&mut self, cell_id: String)

Assign to a cell (LWW-Register operation)

Source

fn leave_cell(&mut self)

Remove from cell (LWW-Register operation)

Source

fn assign_zone(&mut self, zone_id: String)

Assign to a zone (LWW-Register operation)

Source

fn leave_zone(&mut self)

Remove from zone (LWW-Register operation)

Source

fn consume_fuel(&mut self, minutes: u32)

Consume fuel (PN-Counter decrement operation)

Source

fn replenish_fuel(&mut self, minutes: u32)

Replenish fuel (PN-Counter increment operation)

Source

fn is_operational(&self) -> bool

Check if platform is operational

Source

fn needs_refuel(&self) -> bool

Check if platform needs refueling (below 25% capacity)

Source

fn merge(&mut self, other: &NodeState)

Merge with another state (LWW-Register merge)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§