Skip to main content

ArgumentResultExt

Trait ArgumentResultExt 

Source
pub trait ArgumentResultExt<T>: Sealed + Sized {
    // Required method
    fn with_path_prefix(self, prefix: &str) -> ArgumentResult<T>;
}
Expand description

Adds nested argument-path context to validation results.

Successful results are returned unchanged and do not allocate a path. Failed results consume their crate::ArgumentError and prepend the supplied parent path while preserving the structured failure kind.

The trait is sealed and implemented only for ArgumentResult.

Required Methods§

Source

fn with_path_prefix(self, prefix: &str) -> ArgumentResult<T>

Prepends a parent path to a validation failure.

§Parameters
  • prefix: The parent path to add before an error’s current path.
§Returns

The unchanged successful value, or the original validation error with its path prefixed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§