pub fn with_precondition_failure(violations: impl Into<Vec<PreconditionViolation>>) -> Self {
        ErrorDetails {
            precondition_failure: Some(PreconditionFailure::new(violations)),
            ..ErrorDetails::new()
        }
    }
Generates an [`ErrorDetails`] struct with [`PreconditionFailure`]
details and remaining fields set to `None`.

# Examples

```
use tonic_types::{ErrorDetails, PreconditionViolation};

let err_details = ErrorDetails::with_precondition_failure(vec![
PreconditionViolation::new(
"violation type 1",
"subject 1",
"description 1",
),
PreconditionViolation::new(
"violation type 2",
"subject 2",
"description 2",
),
]);
```
tonic-types/src/richer_error/error_details/mod.rs