/// Validates an instance ID str.
/// An instance ID should not exceed MAX_INSTANCE_ID_LEN chars
/// and is only allowed to contain alphanumeric chars and hyphens.
Validates an instance ID str.
An instance ID should not exceed MAX_INSTANCE_ID_LEN chars
and is only allowed to contain alphanumeric chars and hyphens.
Validates an instance ID str . An instance ID should not exceed MAX_INSTANCE_ID_LEN chars and is only allowed to contain alphanumeric chars and hyphens .
pub fn validate_instance_id(input: &str) -> Result<(), Error> {
    if input.len() > MAX_INSTANCE_ID_LEN {
        return Err(Error::InvalidLen(input.len(), MAX_INSTANCE_ID_LEN));
    }
    for (i, c) in input.chars().enumerate() {
        if !(c == '-' || c.is_alphanumeric()) {
            return Err(Error::InvalidChar(c, i));
        }
    }
    Ok(())
}
pub fn validate_instance_id ( input : & str ) -> Result < ( ) , Error > { if input . len ( ) > MAX_INSTANCE_ID_LEN { return Err ( Error :: InvalidLen ( input . len ( ) , MAX_INSTANCE_ID_LEN ) ) ; } for ( i , c ) in input . chars ( ) . enumerate ( ) { if ! ( c == '-' || c . is_alphanumeric ( ) ) { return Err ( Error :: InvalidChar ( c , i ) ) ; } } Ok ( ( ) ) }
Validates an instance ID str.
Validates an instance ID str .
input
&str