pub struct ProcessInfoBuilder { /* private fields */ }Expand description
Builds a ProcessInfo, which is #[non_exhaustive] and so cannot be
written as a struct literal outside this crate.
Every setter takes the field’s own type, Option included, so a caller
already holding Option<u32> writes .pid(entry.pid()) rather than an
if let ladder. A setter is skipped, not passed None, when a row has
nothing to say about that field; the skipped defaults are the ones a
not-yet-running sheep has.
Implementations§
Source§impl ProcessInfoBuilder
impl ProcessInfoBuilder
Sourcepub fn pid(self, pid: Option<u32>) -> Self
pub fn pid(self, pid: Option<u32>) -> Self
Sets the OS pid; None while the sheep is not running.
Sourcepub fn uptime_ms(self, uptime_ms: u64) -> Self
pub fn uptime_ms(self, uptime_ms: u64) -> Self
Sets milliseconds since the last successful start.
Sourcepub fn cpu_percent(self, cpu_percent: Option<f32>) -> Self
pub fn cpu_percent(self, cpu_percent: Option<f32>) -> Self
Sets tree CPU as a percentage of one core.
Sourcepub fn memory_bytes(self, memory_bytes: Option<u64>) -> Self
pub fn memory_bytes(self, memory_bytes: Option<u64>) -> Self
Sets tree resident set size in bytes.
Sourcepub fn dog(self, dog: Option<DogSource>) -> Self
pub fn dog(self, dog: Option<DogSource>) -> Self
Marks this row a dog and names where the dog came from.
Sourcepub fn lambs(self, lambs: Option<Vec<Lamb>>) -> Self
pub fn lambs(self, lambs: Option<Vec<Lamb>>) -> Self
Sets the sheep’s lamb list; None when this reply did not walk for one.
Sourcepub fn last_exit(self, last_exit: Option<ExitInfo>) -> Self
pub fn last_exit(self, last_exit: Option<ExitInfo>) -> Self
Sets how this sheep’s process most recently stopped; None while it
has never exited under this daemon.
Sourcepub fn smit(self, smit: Option<String>) -> Self
pub fn smit(self, smit: Option<String>) -> Self
Sets the marker a dog has painted on this sheep; None when none has.
Sourcepub fn instance(self, instance: Option<u32>) -> Self
pub fn instance(self, instance: Option<u32>) -> Self
Sets the instance slot; None when the peer daemon predates the field.
Sourcepub fn handshook(self, handshook: Option<bool>) -> Self
pub fn handshook(self, handshook: Option<bool>) -> Self
Sets whether this dog has handshaken with the shepherd; None for a
sheep, which has no handshake to report.
Sourcepub fn dog_stale(self, dog_stale: Option<bool>) -> Self
pub fn dog_stale(self, dog_stale: Option<bool>) -> Self
Sets whether the shepherd has given up restarting this dog; None
for a sheep, which is never given up on.
Sourcepub fn pending(self, pending: Option<Vec<String>>) -> Self
pub fn pending(self, pending: Option<Vec<String>>) -> Self
Sets the field names a load has parked for this sheep’s next spawn;
None when nothing is parked.
Sourcepub fn overridden(self, overridden: Option<Vec<String>>) -> Self
pub fn overridden(self, overridden: Option<Vec<String>>) -> Self
Sets the field names an operator has overridden on this sheep;
None when there is nothing to report.
Sourcepub fn build(self) -> ProcessInfo
pub fn build(self) -> ProcessInfo
Finishes the row.
Trait Implementations§
Source§impl Clone for ProcessInfoBuilder
impl Clone for ProcessInfoBuilder
Source§fn clone(&self) -> ProcessInfoBuilder
fn clone(&self) -> ProcessInfoBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more