pub struct ExpverHandler;Expand description
Experiment version validation handler
Handles experiment version identifiers for different runs and model versions
- Numeric versions: Integers that are zero-padded to 4 digits (e.g., 1 → “0001”)
- String versions: Alphanumeric identifiers converted to lowercase (e.g., “PROD” → “prod”)
The canonicalization ensures consistent representation for topic generation and database storage while supporting the flexibility needed by different operational workflows.
Implementations§
Source§impl ExpverHandler
impl ExpverHandler
Sourcepub fn validate_and_canonicalize(
value: &str,
default: Option<&str>,
field_name: &str,
) -> Result<String>
pub fn validate_and_canonicalize( value: &str, default: Option<&str>, field_name: &str, ) -> Result<String>
Validate and canonicalize an experiment version value
This method handles both numeric and string experiment versions:
- Numeric values are zero-padded to 4 digits for consistency
- String values are converted to lowercase for standardization
- Empty values use the configured default if available
§Arguments
value- The experiment version to validate (can be empty if default provided)default- Optional default value to use when input is emptyfield_name- Name of the field being validated (for error messages)
§Returns
Ok(String)- The canonicalized experiment versionErr(anyhow::Error)- Empty value with no default provided
Auto Trait Implementations§
impl Freeze for ExpverHandler
impl RefUnwindSafe for ExpverHandler
impl Send for ExpverHandler
impl Sync for ExpverHandler
impl Unpin for ExpverHandler
impl UnsafeUnpin for ExpverHandler
impl UnwindSafe for ExpverHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more