pub fn prepare_text_validator<V, M>(
validator: V,
map_error: M,
) -> Arc<dyn PreparedValidator> ⓘExpand description
Prepares a text validator using a domain-error mapper.
The returned adapter rejects non-text erased inputs and converts each domain
error with map_error; callers should ensure the mapper does not retain raw
input in the resulting draft.
§Type Parameters
V: Validator of borrowed text with unit context.M: Mapper from the validator error to a safe violation draft.
§Panics
This function does not panic. The prepared adapter reports an input-shape error if it receives a non-text value.
§Parameters
validator: Thread-safe validator for borrowed text with unit context.map_error: Converts each domain error to safe violation metadata.
§Returns
A shared prepared adapter that checks for text input before validation.