pub struct ObservedJob {
pub job: JobSnapshot,
pub observed_at: Timestamp,
}Expand description
The printer’s job, as one read observed it.
Fields§
§job: JobSnapshotWhat the printer reported.
observed_at: TimestampThe instant the report was read at.
Implementations§
Source§impl ObservedJob
impl ObservedJob
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Whether the printer is running this job, or has paused it part-way.
Sourcepub fn running_time_s(&self) -> Option<i64>
pub fn running_time_s(&self) -> Option<i64>
The running time the printer reported for this job, when it reported one a job can have run for.
A negative count is no running time at all, so it is read as none rather than as a job that began after it was observed: the file name is then the whole of what is known, as it is for a printer reporting none.
Sourcepub fn started_at(&self) -> Option<Timestamp>
pub fn started_at(&self) -> Option<Timestamp>
When the job began, less every pause it has resumed from: the instant it was observed, less the running time the printer reported for it then. Unknown when it reported none.
Sourcepub fn printing_time_s(&self) -> Option<i64>
pub fn printing_time_s(&self) -> Option<i64>
How long the job has spent printing, when this read found it printing and reporting a running time; a paused job’s running time counts the pause, so it is not one.