pub struct LinuxSnapshotBuilder { /* private fields */ }Expand description
Builder for a Linux snapshot. Defaults assume a healthy desktop host.
Implementations§
Source§impl LinuxSnapshotBuilder
impl LinuxSnapshotBuilder
Sourcepub const fn logical_cores(self, cores: u32) -> Self
pub const fn logical_cores(self, cores: u32) -> Self
Override logical core count.
Sourcepub const fn iowait_pct(self, pct: f32) -> Self
pub const fn iowait_pct(self, pct: f32) -> Self
Override aggregate CPU I/O-wait percentage.
Sourcepub const fn load(self, one: f32, five: f32, fifteen: f32) -> Self
pub const fn load(self, one: f32, five: f32, fifteen: f32) -> Self
Override the load-average triple.
Sourcepub const fn memory(self, used_bytes: u64, total_bytes: u64) -> Self
pub const fn memory(self, used_bytes: u64, total_bytes: u64) -> Self
Override used and total memory bytes.
Sourcepub const fn swap(self, used_bytes: u64, total_bytes: u64) -> Self
pub const fn swap(self, used_bytes: u64, total_bytes: u64) -> Self
Override used and total swap bytes.
Sourcepub const fn sample_interval_ms(self, ms: u64) -> Self
pub const fn sample_interval_ms(self, ms: u64) -> Self
Override the sampling interval.
Sourcepub const fn observed_at_unix_ms(self, ms: u64) -> Self
pub const fn observed_at_unix_ms(self, ms: u64) -> Self
Override the observation timestamp.
Sourcepub fn build(self) -> StatusSnapshot
pub fn build(self) -> StatusSnapshot
Build the snapshot and run StatusSnapshot::validate.
§Panics
Panics if the resulting snapshot violates a protocol invariant. Tests build snapshots from well-known values, so a panic here indicates a regression in the builder defaults.
Trait Implementations§
Source§impl Clone for LinuxSnapshotBuilder
impl Clone for LinuxSnapshotBuilder
Source§fn clone(&self) -> LinuxSnapshotBuilder
fn clone(&self) -> LinuxSnapshotBuilder
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 LinuxSnapshotBuilder
impl Debug for LinuxSnapshotBuilder
Auto Trait Implementations§
impl Freeze for LinuxSnapshotBuilder
impl RefUnwindSafe for LinuxSnapshotBuilder
impl Send for LinuxSnapshotBuilder
impl Sync for LinuxSnapshotBuilder
impl Unpin for LinuxSnapshotBuilder
impl UnsafeUnpin for LinuxSnapshotBuilder
impl UnwindSafe for LinuxSnapshotBuilder
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