MCPcopy Create free account
hub / github.com/evilsocket/cake / get_node_for_layer

Method get_node_for_layer

cake-core/src/cake/sharding/topology.rs:184–193  ·  view source on GitHub ↗

Return the node serving the specified layer, or None if not found.

(&self, layer_name: &str)

Source from the content-addressed store, hash-verified

182
183 /// Return the node serving the specified layer, or None if not found.
184 pub fn get_node_for_layer(&self, layer_name: &str) -> Option<(&str, &Node)> {
185 for (node_name, node) in &self.0 {
186 for node_layer_name in &node.layers {
187 if layer_name == node_layer_name {
188 return Some((node_name, node));
189 }
190 }
191 }
192 None
193 }
194
195 /// Returns `true` if any node in this topology has an empty `layers` list,
196 /// meaning layer assignments should be computed automatically.

Callers 9

get_node_for_layerFunction · 0.80
generate_imageMethod · 0.80
generate_imageMethod · 0.80
loadMethod · 0.80
loadMethod · 0.80
loadMethod · 0.80
loadMethod · 0.80
loadMethod · 0.80

Calls

no outgoing calls

Tested by 1