MCPcopy Create free account
hub / github.com/PacktPublishing/Rust-for-Blockchain-Application-Development / new

Method new

chapter 5/config.rs:20–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19impl Config {
20 pub fn new() -> Config {
21
22 let mut node_addr = String::from(DEFAULT_NODE_ADDR);
23 if let Ok(addr) = env::var("NODE_ADDRESS") {
24 node_addr = addr;
25 }
26 let mut map = HashMap::new();
27 map.insert(String::from(NODE_ADDRESS_KEY), node_addr);
28
29 Config {
30 inner: RwLock::new(map),
31 }
32 }
33
34
35 pub fn get_node_addr(&self) -> String {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected