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: message.rs
    path of file: ./repos/nox/crates/peer-metrics/src/services_metrics
    
    the code of the file until where you have to start completion: use crate::ServiceType;
use fluence_app_service::MemoryStats;
use std::collections::HashMap;

pub type ModuleName = String;
pub type MemorySize = u64;

/// Service function call stats to store in memory
#[derive(Debug)]
pub enum ServiceCallStats {
    Success {
        memor
    
    pub fn new(stats: &MemoryStats) -> ServiceMemoryStat {
        let mut modules_stats = HashMap::new();
        let mut used_mem: MemorySize = 0;
        for stat in &stats.modules {
            modules_stats.insert(stat.name.to_string(), stat.memory_size as MemorySize);
            used_mem += stat.memory_size as MemorySize;
        }
        ServiceMemoryStat {
            used_mem,
            modules_stats,
        }
    }