profile!() { /* proc-macro */ }
Expand description
Returns a const Profile
validated at compile time.
§Examples
Instantiate a valid Profile
at compile time:
// use peace::cfg::{profile, Profile};
let _my_profile: Profile = profile!("valid_id"); // Ok!
If the ID is invalid, a compilation error is produced:
ⓘ
// use peace::cfg::{profile, Profile};
let _my_profile: Profile = profile!("-invalid_id"); // Compile error
// ^^^^^^^^^^^^^^^^^^^^^^^
// error: "-invalid_id" is not a valid `Profile`.
// `Profile`s must begin with a letter or underscore, and contain only letters, numbers, or underscores.