Convenience function to allow for easy instrumenting
(&mut self, routable_event: RoutableEvent)
| 107 | |
| 108 | /// Convenience function to allow for easy instrumenting |
| 109 | fn feed_inner(&mut self, routable_event: RoutableEvent) -> Option<&ClockParameters> { |
| 110 | // First route the event to the correct inner source |
| 111 | let alg_output = match routable_event { |
| 112 | RoutableEvent::LinkLocal(event) => Self::feed_link_local(&mut self.link_local, event), |
| 113 | RoutableEvent::NtpSource(sender_address, event) => { |
| 114 | Self::feed_ntp_source(&mut self.ntp_sources, sender_address, event) |
| 115 | } |
| 116 | RoutableEvent::Phc(event) => { |
| 117 | // unwrap: feeding a phc event without PHC built is a bug |
| 118 | let phc = self.phc.as_mut().unwrap(); |
| 119 | Self::feed_phc(phc, event) |
| 120 | } |
| 121 | }; |
| 122 | let (clock_parameters, source_info) = alg_output?; |
| 123 | |
| 124 | let output = self.selector.update(clock_parameters, source_info); |
| 125 | if output.is_some() { |
| 126 | Self::update_selected_clock(&self.selected_clock, source_info); |
| 127 | } |
| 128 | |
| 129 | output |
| 130 | } |
| 131 | |
| 132 | // wrapper around feed_inner that emits reproducibility |
| 133 | fn feed_repro(&mut self, routable_event: RoutableEvent) -> Option<&ClockParameters> { |
no test coverage detected