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: persistence.rs
    path of file: ./repos/nox/particle-services/src
    
    the code of the file until where you have to start completion: /*
 * Copyright 2020 Fluence Labs Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

use std::path::{Path, PathBuf};

use serde::{Deserialize, Serialize};

use crate::app_services::Service;
use crate::error::ServiceError;
use crate::ServiceError::{SerializePersistedService
    
    async fn test_persistence() {
        let tmp_dir = tempfile::tempdir().expect("Could not get temp dir");
        let owner_id = RandomPeerId::random();
        let service_1 = PersistedService {
            service_id: "service_id_1".to_string(),
            service_type: None,
            blueprint_id: "blueprint_id_1".to_string(),
            aliases: vec!["alias_1".to_string()],
            owner_id,
            peer_scope: PeerScope::WorkerId(owner_id.into()),
        };
        service_1
            .persist(tmp_dir.path())
            .await
            .expect("Could not persist service");

        let service_2 = PersistedService {
            service_id: "service_id_2".to_string(),
            service_type: None,
            blueprint_id: "blueprint_id_2".to_string(),
            aliases: vec!["alias_2".to_string()],
            owner_id,
            peer_scope: PeerScope::Host,
        };
        service_2
            .persist(tmp_dir.path())
            .await
            .expect("Could not persist service");

        let result: Vec<PersistedService> = load_persisted_services(tmp_dir.path())
            .await
            .expect("Could not load persisted services")
            .into_iter()
            .map(|(s, _)| s)
            .collect();

        assert_eq!(result.len(), 2);
        assert!(result.contains(&service_1));
        assert!(result.contains(&service_2));
    }