fn allow_command_event(&self, event: &CommandEvent) -> bool {
        if event.command_name() == "configureFailPoint" {
            return false;
        }
        if let Some(ignore_command_names) = self.ignore_command_names.as_ref() {
            if ignore_command_names
                .iter()
                .any(|name| event.command_name().eq_ignore_ascii_case(name))
            {
                return false;
            }
        }
        if !self.observe_sensitive_commands {
            let lower_name = event.command_name().to_ascii_lowercase();
            // If a hello command has been redacted, it's sensitive and the event should be
            // ignored.
            let is_sensitive_hello = HELLO_COMMAND_NAMES.contains(lower_name.as_str())
                && match event {
                    CommandEvent::Started(ev) => ev.command.is_empty(),
                    CommandEvent::Succeeded(ev) => ev.reply.is_empty(),
                    CommandEvent::Failed(_) => false,
                };
            if is_sensitive_hello || REDACTED_COMMANDS.contains(lower_name.as_str()) {
                return false;
            }
        }
        true
    }
/// Returns `true` if a given `CommandEvent` is allowed to be observed.
Returns `true` if a given `CommandEvent` is allowed to be observed.
Returns ` true ` if a given ` CommandEvent ` is allowed to be observed .
fn allow_command_event(&self, event: &CommandEvent) -> bool {
        if event.command_name() == "configureFailPoint" {
            return false;
        }
        if let Some(ignore_command_names) = self.ignore_command_names.as_ref() {
            if ignore_command_names
                .iter()
                .any(|name| event.command_name().eq_ignore_ascii_case(name))
            {
                return false;
            }
        }
        if !self.observe_sensitive_commands {
            let lower_name = event.command_name().to_ascii_lowercase();
            // If a hello command has been redacted, it's sensitive and the event should be
            // ignored.
            let is_sensitive_hello = HELLO_COMMAND_NAMES.contains(lower_name.as_str())
                && match event {
                    CommandEvent::Started(ev) => ev.command.is_empty(),
                    CommandEvent::Succeeded(ev) => ev.reply.is_empty(),
                    CommandEvent::Failed(_) => false,
                };
            if is_sensitive_hello || REDACTED_COMMANDS.contains(lower_name.as_str()) {
                return false;
            }
        }
        true
    }
fn allow_command_event ( & self , event : & CommandEvent ) -> bool { if event . command_name ( ) == " " { return false ; } if let Some ( ignore_command_names ) = self . ignore_command_names . as_ref ( ) { if ignore_command_names . iter ( ) . any ( | name | event . command_name ( ) . eq_ignore_ascii_case ( name ) ) { return false ; } } if ! self . observe_sensitive_commands { let lower_name = event . command_name ( ) . to_ascii_lowercase ( ) ; // If a hello command has been redacted, it's sensitive and the event should be // ignored. let is_sensitive_hello = HELLO_COMMAND_NAMES . contains ( lower_name . as_str ( ) ) && match event { CommandEvent :: Started ( ev ) => ev . command . is_empty ( ) , CommandEvent :: Succeeded ( ev ) => ev . reply . is_empty ( ) , CommandEvent :: Failed ( _ ) => false , } ; if is_sensitive_hello || REDACTED_COMMANDS . contains ( lower_name . as_str ( ) ) { return false ; } } true }
Returns `true` if a given `CommandEvent` is allowed to be observed.
Returns ` true ` if a given ` CommandEvent ` is allowed to be observed .
&self
event
&CommandEvent
&self
event
&CommandEvent