pub fn new(steps: &[Step]) -> Self {
            let (storage_downtime, runtime_downtime) =
                match steps.iter().max_by_key(|s| s.meta.after) {
                    Some(max_after) => (
                        Uptime::storage_downtime(steps, max_after.meta.after),
                        Uptime::runtime_downtime(steps, max_after.meta.after),
                    ),
                    None => (IntervalTree::default(), IntervalTree::default()),
                };
            Uptime {
                storage_downtime,
                runtime_downtime,
            }
        }
/// Returns a new [Uptime] from the given steps.
///
/// Steps must be sorted by before.
Returns a new [Uptime] from the given steps.
Steps must be sorted by before.
Returns a new [ Uptime ] from the given steps . Steps must be sorted by before .
pub fn new(steps: &[Step]) -> Self {
            let (storage_downtime, runtime_downtime) =
                match steps.iter().max_by_key(|s| s.meta.after) {
                    Some(max_after) => (
                        Uptime::storage_downtime(steps, max_after.meta.after),
                        Uptime::runtime_downtime(steps, max_after.meta.after),
                    ),
                    None => (IntervalTree::default(), IntervalTree::default()),
                };
            Uptime {
                storage_downtime,
                runtime_downtime,
            }
        }
pub fn new ( steps : & [ Step ] ) -> Self { let ( storage_downtime , runtime_downtime ) = match steps . iter ( ) . max_by_key ( | s | s . meta . after ) { Some ( max_after ) => ( Uptime :: storage_downtime ( steps , max_after . meta . after ) , Uptime :: runtime_downtime ( steps , max_after . meta . after ) , ) , None => ( IntervalTree :: default ( ) , IntervalTree :: default ( ) ) , } ; Uptime { storage_downtime , runtime_downtime , } }
Returns a new [Uptime] from the given steps.
Returns a new [ Uptime ] from the given steps .
steps
&[Step]
steps
&[Step]