pub fn to_nagios_string(&self) -> String {
        let mut s = String::new();

        if let Some(ref name) = self.name {
            s.push_str(&format!("{} ", name))
        }

        s.push_str(&self.get_state().to_string());

        if let Some(ref description) = self.description {
            s.push_str(&format!(": {}", description));
        }

        if self.metrics.len() > 0 {
            s.push_str(" |");

            for metric in self.metrics.iter() {
                s.push_str(&format!(" {}", metric.perf_string()));
            }
        }

        s
    }
/// Returns a string which nagios understands to determine the service state.
///
/// This function will automatically determine which service state is appropriate based on the
/// included metrics. If state has been set manually it will always use the manually set state.
Returns a string which nagios understands to determine the service state.
This function will automatically determine which service state is appropriate based on the
included metrics. If state has been set manually it will always use the manually set state.
Returns a string which nagios understands to determine the service state . This function will automatically determine which service state is appropriate based on the included metrics . If state has been set manually it will always use the manually set state .
pub fn to_nagios_string(&self) -> String {
        let mut s = String::new();
        if let Some(ref name) = self.name {
            s.push_str(&format!("{} ", name))
        }
        s.push_str(&self.get_state().to_string());
        if let Some(ref description) = self.description {
            s.push_str(&format!(": {}", description));
        }
        if self.metrics.len() > 0 {
            s.push_str(" |");
            for metric in self.metrics.iter() {
                s.push_str(&format!(" {}", metric.perf_string()));
            }
        }
        s
    }
pub fn to_nagios_string ( & self ) -> String { let mut s = String :: new ( ) ; if let Some ( ref name ) = self . name { s . push_str ( & format ! ( " " name ) ) } s . push_str ( & self . get_state ( ) . to_string ( ) ) ; if let Some ( ref description ) = self . description { s . push_str ( & format ! ( " " description ) ) ; } if self . metrics . len ( ) > 0 { s . push_str ( " " ) ; for metric in self . metrics . iter ( ) { s . push_str ( & format ! ( " " metric perf_string ( ) ) ) ; } } s }
Returns a string which nagios understands to determine the service state.
Returns a string which nagios understands to determine the service state .
&self
&self