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: client.rs
    path of file: ./repos/Ambient/crates/network/src
    
    the code of the file until where you have to start completion: use ambient_core::{gpu, window::window_scale_factor};
use ambient_ecs::{components, Resource, World};
use ambient_element::{consume_context, elem
    
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let loss = self.packets_lost as f32 / self.packets_sent as f32;
        write!(
            f,
            "{:?} ms rtt, {}/s out, {}/s in, {:.03} loss",
            self.latency_ms,
            to_byte_unit(self.bytes_sent),
            to_byte_unit(self.bytes_received),
            if loss.is_nan() { 0.0 } else { loss },
        )
    }