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: local_device_manager.rs
    path of file: ./repos/CYFS/src/component/cyfs-util/src/util
    
    the code of the file until where you have to start completion: use cyfs_base::{
    BuckyError, BuckyErrorCode, BuckyResult, Device, FileDecoder, NamedObject, PrivateKey,
    StandardObject,
};

use std::collections::{hash_map::Entry, HashMap};
use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex};

use lazy_static::lazy_static;

#[derive(Clone, Debug)]
pub struct DeviceInfo {
    pub device: Device,

    pub private_key: Option<PrivateKey>,
}

// 用以管理本地磁盘上的device文件和密钥
struct LocalDeviceMana
    
    pub fn add(&mut self, name: &str, device: DeviceInfo) -> BuckyResult<()> {
        match self.list.entry(name.to_owned()) {
            Entry::Occupied(_o) => {
                error!(
                    "direct add new device but already exists! id={}, device={}",
                    name,
                    device.device.desc().device_id()
                );

                Err(BuckyError::from(BuckyErrorCode::AlreadyExists))
            }
            Entry::Vacant(v) => {
                info!(
                    "direct add new device info: id={}, device={}",
                    name,
                    device.device.desc().device_id()
                );
                v.insert(device);

                Ok(())
            }
        }
    }