pub fn add_cpu_cores(&mut self) {
        let mut cores = Topology::generate_cpu_cores().unwrap();
        while !cores.is_empty() {
            let c = cores.pop().unwrap();
            let socket_id = &c
                .attributes
                .get("physical id")
                .unwrap()
                .parse::<u16>()
                .unwrap();
            let socket = self
                .sockets
                .iter_mut()
                .find(|x| &x.id == socket_id)
                .expect("Trick: if you are running on a vm, do not forget to use --vm parameter invoking scaphandre at the command line");
            if socket_id == &socket.id {
                socket.add_cpu_core(c);
            }
        }
    }
/// Generates CPUCore instances for the host and adds them
/// to appropriate CPUSocket instance from self.sockets
Generates CPUCore instances for the host and adds them
to appropriate CPUSocket instance from self.sockets
Generates CPUCore instances for the host and adds them to appropriate CPUSocket instance from self . sockets
pub fn add_cpu_cores(&mut self) {
        let mut cores = Topology::generate_cpu_cores().unwrap();
        while !cores.is_empty() {
            let c = cores.pop().unwrap();
            let socket_id = &c
                .attributes
                .get("physical id")
                .unwrap()
                .parse::<u16>()
                .unwrap();
            let socket = self
                .sockets
                .iter_mut()
                .find(|x| &x.id == socket_id)
                .expect("Trick: if you are running on a vm, do not forget to use --vm parameter invoking scaphandre at the command line");
            if socket_id == &socket.id {
                socket.add_cpu_core(c);
            }
        }
    }
pub fn add_cpu_cores ( & mut self ) { let mut cores = Topology :: generate_cpu_cores ( ) . unwrap ( ) ; while ! cores . is_empty ( ) { let c = cores . pop ( ) . unwrap ( ) ; let socket_id = & c . attributes . get ( " " ) . unwrap ( ) . parse :: < u16 > ( ) . unwrap ( ) ; let socket = self . sockets . iter_mut ( ) . find ( | x | & x . id == socket_id ) . expect ( " " ) ; if socket_id == & socket . id { socket . add_cpu_core ( c ) ; } } }
Generates CPUCore instances for the host and adds them
to appropriate CPUSocket instance from self.sockets
Generates CPUCore instances for the host and adds them to appropriate CPUSocket instance from self . sockets
&mut self
&mut self