Skip to main content

validate_name

Function validate_name 

Source
pub fn validate_name(name: &str) -> Result<(), ProfileNameError>
Expand description

Validate a profile name.

The accepted set โ€” lowercase alphanumerics and -, 1โ€“MAX_PROFILE_NAME_LEN characters, no leading or trailing - โ€” is deliberately narrower than what most clients accept. Ollama-style name:tag ids prove that colons and hyphens are safe in OpenAI-compatible frontends, but there are field reports of ids containing underscores being rejected where the same id without one worked. This set is the conservative intersection.

ยงErrors

Returns the specific ProfileNameError describing the first rule violated.