MCPcopy Create free account
hub / github.com/circlefin/arc-node / from

Method from

crates/quake/src/node.rs:82–95  ·  view source on GitHub ↗

Create a new SubnetIps from the given subnet names and indexes. An IP address is built based on the subnet index, the container index, and the node index.

(
        kind: ContainerKind,
        subnet_indexes: &[(SubnetName, usize)],
        node_index: usize,
    )

Source from the content-addressed store, hash-verified

80 /// Create a new SubnetIps from the given subnet names and indexes.
81 /// An IP address is built based on the subnet index, the container index, and the node index.
82 pub fn from(
83 kind: ContainerKind,
84 subnet_indexes: &[(SubnetName, usize)],
85 node_index: usize,
86 ) -> Self {
87 let subnets = subnet_indexes
88 .iter()
89 .map(|(subnet_name, subnet_index)| {
90 let ip = Container::build_ip_address(*subnet_index, kind.index(), node_index);
91 (subnet_name.clone(), ip)
92 })
93 .collect::<IndexMap<_, _>>();
94 Self(subnets)
95 }
96}
97
98impl std::fmt::Display for SubnetIps {

Callers 3

index.test.tsFile · 0.45

Calls 3

iterMethod · 0.80
cloneMethod · 0.80
indexMethod · 0.45

Tested by

no test coverage detected