pub struct SpeedTestResult {
pub bytes_received: usize,
pub bytes_sent: usize,
pub download_bps: f64,
pub upload_bps: f64,
pub download_mbps: f64,
pub upload_mbps: f64,
pub ping_ms: f64,
pub client: ClientInfo,
pub server: ServerInfo,
pub share: Option<Value>,
pub timestamp: String,
}Expand description
A processed and cached speedtest result ready for API serving.
This struct stores speeds both in bits per second and megabits per second, along with ping and metadata about client/server.
It is used to cache and respond with speedtest data efficiently.
§Examples
use speedtest_statuspage::models::{SpeedTestResult, ClientInfo, ServerInfo};
let result = SpeedTestResult {
bytes_received: 12345678,
bytes_sent: 87654321,
download_bps: 50000000.0,
upload_bps: 10000000.0,
download_mbps: 50.0,
upload_mbps: 10.0,
ping_ms: 20.0,
client: ClientInfo {
country: "UK".to_string(),
ip: "192.0.2.1".to_string(),
isp: "Example ISP".to_string(),
ispdlavg: "50".to_string(),
isprating: "4".to_string(),
ispulavg: "10".to_string(),
lat: "51.5074".to_string(),
loggedin: "false".to_string(),
lon: "-0.1278".to_string(),
rating: "4.5".to_string(),
},
server: ServerInfo {
cc: "GB".to_string(),
country: "United Kingdom".to_string(),
d: 5.0,
host: "speedtest.example.com".to_string(),
id: "12345".to_string(),
lat: "51.5074".to_string(),
latency: 10.5,
lon: "-0.1278".to_string(),
name: "London Server".to_string(),
sponsor: "Example Sponsor".to_string(),
url: "http://speedtest.example.com".to_string(),
},
share: None,
timestamp: "2025-08-07T12:00:00Z".to_string(),
};
assert_eq!(result.download_mbps, 50.0);
assert_eq!(result.client.isp, "Example ISP");Fields§
§bytes_received: usizeNumber of bytes received.
bytes_sent: usizeNumber of bytes sent.
download_bps: f64Download speed in bits per second.
upload_bps: f64Upload speed in bits per second.
download_mbps: f64Download speed in megabits per second.
upload_mbps: f64Upload speed in megabits per second.
ping_ms: f64Ping time in milliseconds.
client: ClientInfoClient information.
server: ServerInfoServer information.
Optional share data from the speedtest service.
timestamp: StringTimestamp of the speedtest.
Trait Implementations§
Source§impl Clone for SpeedTestResult
impl Clone for SpeedTestResult
Source§fn clone(&self) -> SpeedTestResult
fn clone(&self) -> SpeedTestResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpeedTestResult
impl Debug for SpeedTestResult
Source§impl Default for SpeedTestResult
impl Default for SpeedTestResult
Source§fn default() -> SpeedTestResult
fn default() -> SpeedTestResult
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SpeedTestResult
impl<'de> Deserialize<'de> for SpeedTestResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SpeedTestResult
impl RefUnwindSafe for SpeedTestResult
impl Send for SpeedTestResult
impl Sync for SpeedTestResult
impl Unpin for SpeedTestResult
impl UnsafeUnpin for SpeedTestResult
impl UnwindSafe for SpeedTestResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more