pub struct PathSample {
pub cost: PathCost,
pub reachability: Reachability,
pub interface: PathInterface,
pub power: PowerState,
pub thermal: ThermalState,
pub execution: Execution,
}Expand description
One sample of the path as a platform reports it, before the monitor stamps a generation.
Fields§
§cost: PathCostWhat the path costs.
reachability: ReachabilityWhether a usable path exists.
interface: PathInterfaceThe interface the path runs over.
power: PowerStateThe device’s power source.
thermal: ThermalStateThe device’s thermal state.
execution: ExecutionHow the app is running.
Implementations§
Source§impl PathSample
impl PathSample
Sourcepub const fn desktop() -> Self
pub const fn desktop() -> Self
The desktop default: a reachable, unmetered path of unknown interface, on external power, cool, in the foreground.
Sourcepub const fn from_class(class: ConnectionClass) -> Self
pub const fn from_class(class: ConnectionClass) -> Self
The desktop default on a path whose cost and reachability are class’s: the bridge
from a ConnectionClass source that reports nothing else. adverse is behavioural,
never reported, so it reads as an unmetered path.
Sourcepub fn aged(&self, elapsed: Duration) -> Self
pub fn aged(&self, elapsed: Duration) -> Self
This sample elapsed after it was reported: a background deadline has that much less
time left, down to zero. Everything else is the platform’s to report again.
Sourcepub fn is_new_path(&self, other: &Self) -> bool
pub fn is_new_path(&self, other: &Self) -> bool
Whether other is a different path: its reachability, interface or cost differs.
Power, thermal state and execution change the plan, never the path.
Sourcepub const fn base_class(&self) -> ConnectionClass
pub const fn base_class(&self) -> ConnectionClass
The class the OS reports, before behavioural promotion to adverse.
Trait Implementations§
Source§impl Clone for PathSample
impl Clone for PathSample
Source§fn clone(&self) -> PathSample
fn clone(&self) -> PathSample
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PathSample
Source§impl Debug for PathSample
impl Debug for PathSample
impl Eq for PathSample
Source§impl From<FfiPathSnapshot> for PathSample
impl From<FfiPathSnapshot> for PathSample
Source§fn from(snapshot: FfiPathSnapshot) -> Self
fn from(snapshot: FfiPathSnapshot) -> Self
Source§impl PartialEq for PathSample
impl PartialEq for PathSample
Source§fn eq(&self, other: &PathSample) -> bool
fn eq(&self, other: &PathSample) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PathSample
Auto Trait Implementations§
impl Freeze for PathSample
impl RefUnwindSafe for PathSample
impl Send for PathSample
impl Sync for PathSample
impl Unpin for PathSample
impl UnsafeUnpin for PathSample
impl UnwindSafe for PathSample
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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 more