pub struct SpeedApp {Show 17 fields
pub config: TestConfig,
pub settings: Settings,
pub status: SharedString,
pub phase: Phase,
pub running: bool,
pub download_samples: Vec<f32>,
pub upload_samples: Vec<f32>,
pub download_mbps: f32,
pub upload_mbps: f32,
pub peak_download: f32,
pub peak_upload: f32,
pub ping_ms: f32,
pub location: Option<SharedString>,
pub isp: Option<SharedString>,
pub server: Option<SharedString>,
pub result: Option<SpeedTestResult>,
pub history: Vec<SpeedTestResult>,
}Expand description
The root application entity.
Fields§
§config: TestConfig§settings: Settings§status: SharedString§phase: Phase§running: bool§download_samples: Vec<f32>§upload_samples: Vec<f32>§download_mbps: f32§upload_mbps: f32§peak_download: f32§peak_upload: f32§ping_ms: f32§location: Option<SharedString>§isp: Option<SharedString>§server: Option<SharedString>§result: Option<SpeedTestResult>§history: Vec<SpeedTestResult>Recent past runs, newest first (read from the shared redb history).
Implementations§
Source§impl SpeedApp
impl SpeedApp
Sourcepub fn new() -> Self
pub fn new() -> Self
Build a fresh, side-effect-free state (no disk access — see Self::boot).
Sourcepub fn boot(&mut self)
pub fn boot(&mut self)
Load persisted settings (JSON) and history (redb) from disk.
Kept separate from Self::new so unit tests stay pure and don’t touch
the user’s real config/history files.
Sourcepub fn reload_history(&mut self)
pub fn reload_history(&mut self)
Re-read recent runs from the shared history database.
Sourcepub fn toggle_auto_run(&mut self)
pub fn toggle_auto_run(&mut self)
Toggle the “run a test on launch” preference and persist settings.
Sourcepub fn clear_history(&mut self)
pub fn clear_history(&mut self)
Clear all saved history (and the on-screen list).
Sourcepub fn cycle_server(&mut self)
pub fn cycle_server(&mut self)
Cycle the test server through the built-in presets.
Sourcepub fn adjust_size(&mut self, delta: i64)
pub fn adjust_size(&mut self, delta: i64)
Adjust the test payload size (MB), clamped to a sane range.
Sourcepub fn adjust_timeout(&mut self, delta: i64)
pub fn adjust_timeout(&mut self, delta: i64)
Adjust the per-test timeout (seconds), clamped to a sane range.
Sourcepub fn cycle_detail(&mut self)
pub fn cycle_detail(&mut self)
Cycle the output detail level.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpeedApp
impl RefUnwindSafe for SpeedApp
impl Send for SpeedApp
impl Sync for SpeedApp
impl Unpin for SpeedApp
impl UnsafeUnpin for SpeedApp
impl UnwindSafe for SpeedApp
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().