pub struct Registry {
pub enabled: bool,
pub name: String,
pub url: Option<RegistryUrl>,
pub labels: Vec<String>,
pub last_update: Option<DateTime<Local>>,
pub rpc_endpoints: HashMap<ChainName, Vec<Endpoint>>,
}
Fields§
§enabled: bool
Data won’t be pulled from a disabled registry
name: String
Name of the registry
url: Option<RegistryUrl>
URL of the registry, there may be none for local/default registries
labels: Vec<String>
Optional labels
last_update: Option<DateTime<Local>>
DateTime of the last update of the data
rpc_endpoints: HashMap<ChainName, Vec<Endpoint>>
Items of the registry
Implementations§
Source§impl Registry
impl Registry
pub fn new(name: &str, url: &str) -> Self
Sourcepub fn update(&mut self) -> Result<()>
pub fn update(&mut self) -> Result<()>
Fetch the information from located at the registry’s url and update the registry items
Sourcepub fn refresh_stats(&mut self)
pub fn refresh_stats(&mut self)
Ping all endpoints and refresh the stats
Sourcepub fn ping_all(&mut self)
pub fn ping_all(&mut self)
Ping all endpoints and print the results to stdout.
Calling this function does NOT refresh the stats.
pub fn ping(e: &Endpoint) -> Result<(bool, Option<f32>)>
pub fn save(&self, file: PathBuf) -> Result<()>
pub fn load(file: PathBuf) -> Self
pub fn load_from_url(url: &str) -> Result<Self>
pub fn default_bad() -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Registry
impl<'de> Deserialize<'de> for Registry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Registry
Auto Trait Implementations§
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnwindSafe for Registry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.