You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: benchmark_result.rs
    path of file: ./repos/iggy/bench/src
    
    the code of the file until where you have to start completion: use crate::args::simple::BenchmarkKind;
use colored::Colorize;
use std::collections::HashSet;
use std::{
    fmt::{Display, Formatter},
    time::Duration,
};
use tokio::time::Instant;

#[derive(Debug, Clone, PartialEq)]
pub struct BenchmarkResult {
    pub kind: BenchmarkKind,
    pub start_timestamp: Instant,
    pub end_timestamp: Instant,
    pub average_latency: Durati
    
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        if let Ok(test_type) = self.get_test_type() {
            if test_type == BenchmarkKind::SendAndPoll {
                let producer_statics = self.calculate_statistics(|x| x.kind == BenchmarkKind::Send);
                let consumer_statics = self.calculate_statistics(|x| x.kind == BenchmarkKind::Poll);

                let producer_info = format!("Producer results: total throughput: {:.2} MB/s, {:.0} messages/s, average latency: {:.2} ms, average throughput: {:.2} MB/s, total duration: {:.2} s",
                producer_statics.total_throughput, producer_statics.messages_per_second, producer_statics.average_latency, producer_statics.average_throughput, producer_statics.total_duration).green();

                let consumer_info = format!("Consumer results: total throughput: {:.2} MB/s, {:.0} messages/s, average latency: {:.2} ms, average  throughput: {:.2} MB/s, total duration: {:.2} s",
                consumer_statics.total_throughput, consumer_statics.messages_per_second, consumer_statics.average_latency, consumer_statics.average_throughput, consumer_statics.total_duration).green();
                writeln!(f, "{}, {}", producer_info, consumer_info)?;
            }
        }

        let results = self.calculate_statistics(|x| {
            x.kind == BenchmarkKind::Send || x.kind == BenchmarkKind::Poll
        });

        let summary_info = format!("Results: total throughput: {:.2} MB/s, {:.0} messages/s, average latency: {:.2} ms, average  throughput: {:.2} MB/s, total duration: {:.2} s",
        results.total_throughput, results.messages_per_second, results.average_latency, results.average_throughput, results.total_duration).green();

        writeln!(f, "{}", summary_info)
    }