Skip to main content

build

Function build 

Source
pub fn build(
    endpoint_id: EndpointId,
    mode: LocalDiscovery,
) -> Result<impl AddressLookup>
Expand description

Build the local-discovery lookup for endpoint_id.

Takes the parsed [LocalDiscovery], not a bare bool, deliberately. The 0.44.0 gate mutated the call site from local_disc.advertise to a literal true — putting a node told to listen only on the air, broadcasting its endpoint id — and every deterministic test stayed green. A bare bool makes that a one-character edit; a struct parsed from config makes the same lie require constructing a LocalDiscovery that disagrees with the operator’s file, which is visible at review. It does not make the mistake impossible, and the wire test below is what actually pins it.

Fallible because a machine with no multicast-capable interface cannot run this; boot warns and continues rather than refusing to start, since that is a networking condition rather than a misconfiguration.

Must be called from within a tokio runtime: the crate’s builder relies on Handle::current() and PANICS otherwise.