#![deny(missing_docs)]
mod coding;
mod future_help;
mod handle_info;
mod labels;
mod peer;
mod proxy;
mod router;
mod test_util;
pub use coding::{decode_fidl, encode_fidl};
pub use future_help::log_errors;
pub use labels::{Endpoint, NodeId, NodeLinkId};
pub use proxy::set_proxy_drop_event_handler;
pub use router::{AscenddClientRouting, ListPeersContext, ListablePeer, Router};
pub use test_util::NodeIdGenerator;
#[allow(dead_code)]
pub(crate) trait Trace {
fn trace(self, msg: impl std::fmt::Display, ctx: impl std::fmt::Debug) -> Self
where
Self: Sized;
fn maybe_trace(
self,
trace: bool,
msg: impl std::fmt::Display,
ctx: impl std::fmt::Debug,
) -> Self
where
Self: Sized,
{
if trace {
self.trace(msg, ctx)
} else {
self
}
}
}
impl<X: std::fmt::Debug> Trace for X {
fn trace(self, msg: impl std::fmt::Display, ctx: impl std::fmt::Debug) -> Self
where
Self: Sized,
{
tracing::info!("[{:?}] {}: {:?}", ctx, msg, self);
self
}
}