#[cfg(feature = "exporter")]
pub mod exporter;
#[cfg(feature = "process")]
pub mod process;
pub mod counter;
pub use counter::*;
pub mod gauge;
pub use gauge::*;
pub mod histogram;
pub use histogram::*;
#[cfg(feature = "summary")]
pub mod summary;
#[cfg(feature = "summary")]
pub use summary::*;
#[doc(hidden)]
pub use prometheus;
mod private {
pub trait Sealed {}
impl Sealed for u64 {}
impl Sealed for i64 {}
impl Sealed for f64 {}
impl Sealed for i32 {}
impl Sealed for u32 {}
impl Sealed for usize {}
impl Sealed for f32 {}
}
pub trait IntoAtomic<T>: private::Sealed {
fn into_atomic(self) -> T;
}
impl<T: private::Sealed> IntoAtomic<T> for T {
#[inline]
fn into_atomic(self) -> T {
self
}
}
macro_rules! impl_into_atomic {
($in_ty:ty => $out_ty:ty) => {
impl $crate::IntoAtomic<$out_ty> for $in_ty {
#[inline]
fn into_atomic(self) -> $out_ty {
self as $out_ty
}
}
};
}
impl_into_atomic!(i32 => u64);
impl_into_atomic!(u32 => u64);
impl_into_atomic!(usize => u64);
impl_into_atomic!(i32 => i64);
impl_into_atomic!(u32 => i64);
impl_into_atomic!(usize => i64);
impl_into_atomic!(i32 => f64);
impl_into_atomic!(u32 => f64);
impl_into_atomic!(usize => f64);
impl_into_atomic!(f32 => f64);