mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-10 04:51:22 +00:00
27 lines
544 B
Rust
27 lines
544 B
Rust
use crate::metrics::LocalMetrics;
|
|
use beacon_chain::{BeaconChain, BeaconChainTypes};
|
|
use iron::typemap::Key;
|
|
use prometheus::Registry;
|
|
use std::marker::PhantomData;
|
|
use std::sync::Arc;
|
|
|
|
pub struct BeaconChainKey<T> {
|
|
_phantom: PhantomData<T>,
|
|
}
|
|
|
|
impl<T: BeaconChainTypes + 'static> Key for BeaconChainKey<T> {
|
|
type Value = Arc<BeaconChain<T>>;
|
|
}
|
|
|
|
pub struct MetricsRegistryKey;
|
|
|
|
impl Key for MetricsRegistryKey {
|
|
type Value = Registry;
|
|
}
|
|
|
|
pub struct LocalMetricsKey;
|
|
|
|
impl Key for LocalMetricsKey {
|
|
type Value = LocalMetrics;
|
|
}
|