Skip to main content

check_id

Function check_id 

pub const fn check_id(id: &str) -> Result<(), IdError>
Expand description

Checks id against the naming rule of point and listener ids, <crate>.<subject>.<moment> (the README’s “Naming points”):

  • at least two segments separated by dots, none empty;
  • the first segment, the crate’s prefix, is a lowercase ASCII letter followed by lowercase ASCII letters, digits, _ or -;
  • the other segments are ASCII letters (either case), digits, _ or -.

A const fn, so a table checks its ids at compile time.