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: device_manager.rs
    path of file: ./repos/CYFS/src/component/cyfs-stack/src/resolver
    
    the code of the file until where you have to start completion: use super::obj_searcher::*;
use crate::crypto_api::*;
use cyfs_base::*;
use cyfs_bdt::DeviceCache;
use cyfs_lib::*;

use async_trait::async_trait;
use std::collections::{hash_map::Entry, HashMap};
use std::sync::{Arc, RwLock};

pub(crate) struct DeviceInfoManagerImpl {
    noc
    
    async fn search(&self, device_id: &DeviceId) -> BuckyResult<Device> {
        let mut ret = self
            .obj_searcher
            .search_ex(
                None,
                device_id.object_id(),
                ObjectSearcherFlags::none_local(),
            )
            .await
            .map_err(|e| {
                let msg = format!(
                    "search target device but not found! target={}, {}",
                    device_id, e
                );
                error!("{}", msg);
                BuckyError::new(BuckyErrorCode::TargetNotFound, msg)
            })?;

        let object = ret.take_object();
        if object.obj_type_code() != ObjectTypeCode::Device {
            let msg = format!(
                "unmatch object type, not device: {}, {:?}",
                device_id,
                object.obj_type_code()
            );
            error!("{}", msg);

            return Err(BuckyError::new(BuckyErrorCode::InvalidParam, msg));
        }

        match Arc::try_unwrap(object) {
            Ok(object) => match object {
                AnyNamedObject::Standard(object) => match object {
                    StandardObject::Device(device) => Ok(device),
                    _ => unreachable!(),
                },
                _ => unreachable!(),
            },
            Err(_object) => {
                let device = Device::clone_from_slice(&ret.object_raw).map_err(|e| {
                    let msg = format!(
                        "decode device object error: {}, buf={}, {}",
                        device_id,
                        ::hex::encode(&ret.object_raw),
                        e
                    );
                    error!("{}", msg);

                    BuckyError::new(BuckyErrorCode::InvalidFormat, msg)
                })?;

                Ok(device)
            }
        }
    }