MCPcopy Create free account
hub / github.com/aws/clock-bound / build

Method build

clock-bound/src/shm.rs:168–196  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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)]

Callers 15

constructMethod · 0.45
newMethod · 0.45
feed_serializes_eventsFunction · 0.45
receiver_streamFunction · 0.45
phc_streamFunction · 0.45
add_ntp_sourceFunction · 0.45
remove_ntp_sourceFunction · 0.45
constructMethod · 0.45
write_shm0Method · 0.45
write_shm1Method · 0.45

Calls 1

newFunction · 0.50

Tested by 15

add_ntp_sourceFunction · 0.36
remove_ntp_sourceFunction · 0.36
test_write_shmFunction · 0.36
handle_disruptionFunction · 0.36
packet_builderFunction · 0.36
calculate_local_periodFunction · 0.36