Skip to main content

NetworkData

Struct NetworkData 

Source
pub struct NetworkData {
    pub down_mbps: Option<f64>,
    pub up_mbps: Option<f64>,
    pub ping_ms: Option<f64>,
    pub jitter_ms: Option<f64>,
    pub packet_loss_percent: Option<f64>,
    pub rssi_dbm: Option<f64>,
    pub noise_dbm: Option<f64>,
    pub channel_width_mhz: Option<f64>,
}
Expand description

Represents raw network connection data.

This struct serves as the entry point for Synapse metric calculations. All fields are optional to handle partial cases (e.g., Ethernet without Wi-Fi).

Fields§

§down_mbps: Option<f64>

Download speed in Mbps.

§up_mbps: Option<f64>

Upload speed in Mbps.

§ping_ms: Option<f64>

Latency (Ping) in milliseconds.

§jitter_ms: Option<f64>

Jitter (Ping variation) in milliseconds.

§packet_loss_percent: Option<f64>

Packet loss percentage (e.g., 1.0 for 1%).

§rssi_dbm: Option<f64>

Received Signal Strength Indicator in dBm (e.g., -65.0). Wireless only.

§noise_dbm: Option<f64>

Noise floor in dBm (e.g., -90.0). Wireless only.

§channel_width_mhz: Option<f64>

Wi-Fi channel width in MHz (e.g., 20, 40, 80, 160).

Implementations§

Source§

impl NetworkData

Source

pub fn calculate_vortex(&self) -> Option<f64>

Calculates the VORTEX score (Pure flow performance).

The Vortex measures pipe efficiency. It combines volume (speeds) and fluidity (latency/jitter), penalized by integrity (packet loss).

§Returns
  • Some(score): If all performance data is present.
  • None: If data is missing (ping, speed, etc.).
Source

pub fn calculate_radiance(&self) -> Option<f64>

Calculates the RADIANCE score (Physical signal quality).

Radiance measures the cleanliness of the radio environment. Based on SNR (Signal-to-Noise Ratio) and channel width.

§Returns
  • Some(score): If Wi-Fi data is present.
  • None: If wired (Ethernet) or read error.
Source

pub fn calculate_axon(&self) -> Option<f64>

Calculates the final AXON score (Unified Metric).

Axon is the geometric mean of Vortex (Perf) and Radiance (Phys). It represents the “Real Health” of the connection.

Trait Implementations§

Source§

impl Clone for NetworkData

Source§

fn clone(&self) -> NetworkData

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NetworkData

Source§

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

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

impl Default for NetworkData

Source§

fn default() -> NetworkData

Returns the “default value” for a type. Read more
Source§

impl Copy for NetworkData

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.