pub struct NetworkConfigResponse {
pub networks: HashMap<String, NetworkConfigEntry>,
}Expand description
Per-network chain configuration returned by GET /config/network.
Keys of networks are network names ("testnet", "mainnet");
networks the deployment does not support are simply absent.
Fields§
§networks: HashMap<String, NetworkConfigEntry>Network name → chain metadata.
Implementations§
Source§impl NetworkConfigResponse
impl NetworkConfigResponse
Sourcepub fn entry(&self, network: &str) -> Result<&NetworkConfigEntry>
pub fn entry(&self, network: &str) -> Result<&NetworkConfigEntry>
Return the entry for network name or an Error::Validation if
the deployment does not advertise it.
Sourcepub fn entry_by_chain_id(
&self,
chain_id: i64,
) -> Result<(&str, &NetworkConfigEntry)>
pub fn entry_by_chain_id( &self, chain_id: i64, ) -> Result<(&str, &NetworkConfigEntry)>
Reverse-lookup: find the entry whose chain_id matches. Used when
the caller knows the chain ID (e.g. from escrow params) but not
the network name. Errors if no entry matches.
Trait Implementations§
Source§impl Clone for NetworkConfigResponse
impl Clone for NetworkConfigResponse
Source§fn clone(&self) -> NetworkConfigResponse
fn clone(&self) -> NetworkConfigResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkConfigResponse
impl Debug for NetworkConfigResponse
Source§impl<'de> Deserialize<'de> for NetworkConfigResponse
impl<'de> Deserialize<'de> for NetworkConfigResponse
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
Auto Trait Implementations§
impl Freeze for NetworkConfigResponse
impl RefUnwindSafe for NetworkConfigResponse
impl Send for NetworkConfigResponse
impl Sync for NetworkConfigResponse
impl Unpin for NetworkConfigResponse
impl UnsafeUnpin for NetworkConfigResponse
impl UnwindSafe for NetworkConfigResponse
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