pub fn has_precondition_failure_violations(&self) -> bool {
        if let Some(precondition_failure) = &self.precondition_failure {
            return !precondition_failure.violations.is_empty();
        }
        false
    }
Returns `true` if [`PreconditionFailure`] is set and its `violations`
vector is not empty, otherwise returns `false`.

# Examples

```
use tonic_types::ErrorDetails;

let mut err_details = ErrorDetails::with_precondition_failure(vec![]);

assert_eq!(err_details.has_precondition_failure_violations(), false);

err_details.add_precondition_failure_violation(
"violation type",
"subject",
"description"
);

assert_eq!(err_details.has_precondition_failure_violations(), true);
```
tonic-types/src/richer_error/error_details/mod.rs