2019-05-27 01:34:22 +00:00
|
|
|
use beacon_chain::{BeaconChain, BeaconChainTypes};
|
|
|
|
use iron::typemap::Key;
|
2019-05-28 07:30:09 +00:00
|
|
|
use prometheus::Registry;
|
2019-05-27 01:34:22 +00:00
|
|
|
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>>;
|
|
|
|
}
|
2019-05-28 07:30:09 +00:00
|
|
|
|
|
|
|
pub struct MetricsRegistryKey;
|
|
|
|
|
|
|
|
impl Key for MetricsRegistryKey {
|
|
|
|
type Value = Registry;
|
|
|
|
}
|