pub trait Link {
type Error: Debug;
// Required methods
fn measurement(
&self,
measurement: Measurement,
direction: Direction,
) -> Result<(), Self::Error>;
fn external_data_update(
&self,
root_delay: Duration,
leap_status: Option<LeapStatus>,
usable: bool,
) -> Result<(), Self::Error>;
fn active(&self) -> Result<bool, Self::Error>;
fn importance(&self) -> Result<Option<f64>, Self::Error>;
fn desired_poll_interval(&self) -> Result<Duration, Self::Error>;
fn id(&self) -> LinkId;
}Expand description
A measurement link between clocks.
Required Associated Types§
Required Methods§
Sourcefn measurement(
&self,
measurement: Measurement,
direction: Direction,
) -> Result<(), Self::Error>
fn measurement( &self, measurement: Measurement, direction: Direction, ) -> Result<(), Self::Error>
Process a measurement on a connection.
§Errors
May fail if there are any issues processing the measurement, mostly resulting from unexpected behavior of the underlying clock.
Sourcefn external_data_update(
&self,
root_delay: Duration,
leap_status: Option<LeapStatus>,
usable: bool,
) -> Result<(), Self::Error>
fn external_data_update( &self, root_delay: Duration, leap_status: Option<LeapStatus>, usable: bool, ) -> Result<(), Self::Error>
Update additional time keeping information provided by the remote for this link.
§Errors
May fail if the link does not contain an external clock.
Sourcefn active(&self) -> Result<bool, Self::Error>
fn active(&self) -> Result<bool, Self::Error>
Returns whether the link actively contributed to the current time estimates on the last measurement.
§Errors
May fail only when something is bugged in the library.
Sourcefn importance(&self) -> Result<Option<f64>, Self::Error>
fn importance(&self) -> Result<Option<f64>, Self::Error>
Importance of the links contribution to the phase of the system clock, assuming it
is an external clock. This is the same number provided in
StdController::active_links, which has arbitrary units and shouldn’t be
assumed to be of a certain order of magnitude. A link with twice the importance will
have roughly twice as much impact on the phase of the system clock.
The importance is only available if the link is active and external.
§Errors
May fail when the link is not external
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".