Skip to content
Snippets Groups Projects
Commit 72f00daf authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

circmgr: re-export clock skew estimates.

parent 5f5cbdc0
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,7 @@ mod usage;
pub use err::Error;
pub use isolation::IsolationToken;
use tor_guardmgr::fallback::FallbackList;
pub use tor_guardmgr::{ClockSkewEvents, SkewEstimate};
pub use usage::{TargetPort, TargetPorts};
pub use config::{
......@@ -722,6 +723,17 @@ impl<R: Runtime> CircMgr<R> {
external_activity,
);
}
/// Return a stream of events about our estimated clock skew; these events
/// are `None` when we don't have enough information to make an estimate,
/// and `Some(`[`SkewEstiamte`]`)` otherwise.
///
/// Note that this stream can be lossy: if the estimate changes more than
/// one before you read from the stream, you might only get the most recent
/// update.
pub fn skew_events(&self) -> ClockSkewEvents {
self.mgr.peek_builder().guardmgr().skew_events()
}
}
impl<R: Runtime> Drop for CircMgr<R> {
......
......@@ -12,6 +12,8 @@ use tor_basic_utils::skip_fmt;
///
/// Note that this stream can be lossy: if multiple events trigger before you
/// read from it, you will only get the most recent estimate.
//
// SEMVER NOTE: this type is re-exported from tor-circmgr.
#[derive(Clone, Educe)]
#[educe(Debug)]
pub struct ClockSkewEvents {
......
......@@ -29,6 +29,8 @@ impl SkewObservation {
}
/// An estimate of how skewed our clock is, plus a summary of why we think so.
//
// SEMVER NOTE: this type is re-exported from tor-circmgr.
#[derive(Clone, Debug)]
pub struct SkewEstimate {
/// Our best guess for the magnitude of the skew.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment