mirror of
https://git.proxmox.com/git/proxmox
synced 2025-06-14 16:51:53 +00:00
rrd: add Entry::get() to access the data
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
3bbdcf23e0
commit
3193237afd
@ -90,6 +90,12 @@ impl Entry {
|
|||||||
data,
|
data,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get a data point at a specific index which also does bound checking and returns `None` for
|
||||||
|
/// out of bounds indices.
|
||||||
|
pub fn get(&self, idx: usize) -> Option<f64> {
|
||||||
|
self.data.get(idx).copied().flatten()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Entry> for (u64, u64, Vec<Option<f64>>) {
|
impl From<Entry> for (u64, u64, Vec<Option<f64>>) {
|
||||||
|
Loading…
Reference in New Issue
Block a user