/// Validates a `ClientConfig` instance.
///
/// Performs a series of validations to check if the configuration defined by the `ClientConfig`
/// instance is valid. The instance is valid if:
///   1) a given `SystemMode` is not repeating in multiple `ModeMatch` entries
Validates a `ClientConfig` instance.
Performs a series of validations to check if the configuration defined by the `ClientConfig`
instance is valid. The instance is valid if:
1) a given `SystemMode` is not repeating in multiple `ModeMatch` entries
Validates a ` ClientConfig ` instance . Performs a series of validations to check if the configuration defined by the ` ClientConfig ` instance is valid . The instance is valid if : 1 ) a given ` SystemMode ` is not repeating in multiple ` ModeMatch ` entries
fn validate(&self) -> Result<(), Error> {
        // Ensure a given `SystemMode` is not repeating in multiple `ModeMatch` entries
        {
            let mut modes_set = HashSet::new();
            for mode in self.mode_matches.iter().map(|mode_match| mode_match.mode) {
                ensure!(
                    modes_set.insert(mode),
                    "A given mode may only be specified once (violated by {:?})",
                    mode
                );
            }
        }
        Ok(())
    }
fn validate ( & self ) -> Result < ( ) , Error > { // Ensure a given `SystemMode` is not repeating in multiple `ModeMatch` entries { let mut modes_set = HashSet :: new ( ) ; for mode in self . mode_matches . iter ( ) . map ( | mode_match | mode_match . mode ) { ensure ! ( modes_set insert ( mode ) " " mode ) ; } } Ok ( ( ) ) }
Validates a `ClientConfig` instance.
Validates a ` ClientConfig ` instance .
&self