diff --git a/proxmox-rrd/src/rrd.rs b/proxmox-rrd/src/rrd.rs index 6affa9a5..7d05072f 100644 --- a/proxmox-rrd/src/rrd.rs +++ b/proxmox-rrd/src/rrd.rs @@ -90,6 +90,12 @@ impl Entry { 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 { + self.data.get(idx).copied().flatten() + } } impl From for (u64, u64, Vec>) {