Type Alias IDMap

Source
pub type IDMap = Arc<Mutex<Vec<(String, (u16, Endpoint))>>>;
Expand description

Map of entity IDs to their port and endpoint.

Stores tuples of (ID52 prefix, (port, Iroh endpoint)) for entity lookup. Uses a Vec instead of HashMap because:

  • We need prefix matching for shortened IDs in subdomains
  • The number of entities is typically small per instance
  • Linear search with prefix matching is fast enough

The ID52 strings may be truncated when used in DNS subdomains due to the 63-character limit, so prefix matching allows finding the correct entity.

Aliased Typeยง

pub struct IDMap { /* private fields */ }