Custom `build` finishing function on the generated `ClockErrorBoundLayoutBuilder`. Take the layout version number as a parameter, it is a u16 to ease casting of the earlier version of the `SHMHeader`.
(self, layout_version: ClockErrorBoundLayoutVersion)
| 166 | /// Take the layout version number as a parameter, it is a u16 to ease casting of the earlier |
| 167 | /// version of the `SHMHeader`. |
| 168 | pub fn build(self, layout_version: ClockErrorBoundLayoutVersion) -> ClockErrorBound { |
| 169 | // Build the ClockErrorBoundGeneric object |
| 170 | let ceb = self.build_internal(); |
| 171 | |
| 172 | // Build the specific version of the ClockErrorBound |
| 173 | match layout_version { |
| 174 | ClockErrorBoundLayoutVersion::V2 => ClockErrorBound::V2(ClockErrorBoundV2::new( |
| 175 | ceb.as_of, |
| 176 | ceb.void_after, |
| 177 | ceb.bound_nsec, |
| 178 | ceb.disruption_marker, |
| 179 | ceb.max_drift_ppb, |
| 180 | ceb.clock_status, |
| 181 | ceb.clock_disruption_support_enabled, |
| 182 | )), |
| 183 | ClockErrorBoundLayoutVersion::V3 => ClockErrorBound::V3(ClockErrorBoundV3::new( |
| 184 | ceb.as_of_tsc, |
| 185 | ceb.as_of, |
| 186 | ceb.void_after, |
| 187 | ceb.period, |
| 188 | ceb.period_err, |
| 189 | ceb.bound_nsec, |
| 190 | ceb.disruption_marker, |
| 191 | ceb.max_drift_ppb, |
| 192 | ceb.clock_status, |
| 193 | ceb.clock_disruption_support_enabled, |
| 194 | )), |
| 195 | } |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | #[derive(Copy, Clone)] |