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_config.rs
    path of file: ./repos/CYFS/src/service/ood-daemon/src/config
    
    the code of the file until where you have to start completion: use crate::config::PATHS;
use crate::service::SERVICE_MANAGER;
use cyfs_base::{BuckyError, BuckyResult, BuckyErrorCode};
use super::service_config::*;

use std::path::PathBuf;

pub struct DeviceConfig {
    config_file: PathBuf,
}

impl DeviceConfig {
    pub fn new() -> DeviceConfig {
        let config_file = PATHS.device_config.to_path_buf();
        DeviceConfig { config_file }
    }

    pub async fn load_and_apply_config(&self) -> BuckyResult<()> {
        let list = self.load_config()?;

    
    
    fn parse_config(&self, cfg_node: toml::Value) -> BuckyResult<Vec<ServiceConfig>> {
        if !cfg_node.is_table() {
            let msg = format!(
                "config root node invalid format! file={}",
                self.config_file.display()
            );
            error!("{}", msg);
            return Err(BuckyError::new(BuckyErrorCode::InvalidFormat, msg));
        }

        for (k, v) in cfg_node.as_table().unwrap() {
            match k.as_str() {
                "service" => {
                    if v.is_array() {
                        return ServiceConfig::load_service_list(v.as_array().unwrap());
                    } else {
                        let msg = format!("config invalid service node format");
                        error!("{}", msg);
                        return Err(BuckyError::new(BuckyErrorCode::InvalidFormat, msg));
                    }
                }
                _ => {
                    warn!("unknown device service config node: {}", &k);
                }
            }
        }

        let msg = format!("service node not found in config! {:?}", cfg_node);
        error!("{}", msg);
        Err(BuckyError::new(BuckyErrorCode::InvalidFormat, msg))
    }