Skip to main content

validate_locator

Function validate_locator 

Source
pub fn validate_locator(locator: &str) -> Result<(), &'static str>
Expand description

Validate a locator string format.

Returns Ok(()) if the locator is well-formed, or an error message describing the problem. This provides early feedback before zenoh-pico or XRCE-DDS rejects a bad locator.

Supported formats:

  • TCP: tcp/<host>:<port> (e.g., tcp/127.0.0.1:7447)
  • UDP: udp/<host>:<port> (e.g., udp/192.168.1.50:2019)
  • Serial: serial/<device>#baudrate=<rate> (e.g., serial//dev/ttyUSB0#baudrate=115200)