fn with_timeline(&mut self, subnet_id: SubnetId, f: impl FnOnce(&mut StreamTimeline)) {
        use std::collections::btree_map::Entry;

        match self.timelines.entry(subnet_id) {
            Entry::Occupied(mut o) => f(o.get_mut()),
            Entry::Vacant(v) => {
                let backlog = self.histograms.with_label_values(&[&subnet_id.to_string()]);
                f(v.insert(StreamTimeline::new(backlog)))
            }
        }
    }
/// Helper function: invokes the given function on the [`StreamTimeline`]
/// for the given remote subnet, creating one if it doesn't exist yet.
Helper function: invokes the given function on the [`StreamTimeline`]
for the given remote subnet, creating one if it doesn't exist yet.
Helper function : invokes the given function on the [ ` StreamTimeline ` ] for the given remote subnet creating one if it doesn ' t exist yet .
fn with_timeline(&mut self, subnet_id: SubnetId, f: impl FnOnce(&mut StreamTimeline)) {
        use std::collections::btree_map::Entry;
        match self.timelines.entry(subnet_id) {
            Entry::Occupied(mut o) => f(o.get_mut()),
            Entry::Vacant(v) => {
                let backlog = self.histograms.with_label_values(&[&subnet_id.to_string()]);
                f(v.insert(StreamTimeline::new(backlog)))
            }
        }
    }
fn with_timeline ( & mut self , subnet_id : SubnetId , f : impl FnOnce ( & mut StreamTimeline ) ) { use std :: collections :: btree_map :: Entry ; match self . timelines . entry ( subnet_id ) { Entry :: Occupied ( mut o ) => f ( o . get_mut ( ) ) , Entry :: Vacant ( v ) => { let backlog = self . histograms . with_label_values ( & [ & subnet_id . to_string ( ) ] ) ; f ( v . insert ( StreamTimeline :: new ( backlog ) ) ) } } }
Helper function: invokes the given function on the [`StreamTimeline`]
for the given remote subnet, creating one if it doesn't exist yet.
Helper function : invokes the given function on the [ ` StreamTimeline ` ] for the given remote subnet creating one if it doesn ' t exist yet .
&mut self
subnet_id
SubnetId
f
impl FnOnce(&mut StreamTimeline)
&mut self
subnet_id
SubnetId
f
impl FnOnce(&mut StreamTimeline)