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: system.rs
    path of file: ./repos/smartgpt/src/memory/qdrant
    
    the code of the file until where you have to start completion: use std::collections::HashMap;
use std::error::Error;
use std::sync::Arc;
use std::vec;
use serde::{Serialize, Deserialize};
use tokio::sync::Mutex;

use crate::{LLM, Memory, MemoryProvider, RelevantMemory, MemorySystem, init_qdrant_client, create_collection_if_not_exists, convert_to_relevant_memory};

use qdrant_client::prelude::*;
use qdrant_client::qdrant::vectors::VectorsOptions;
use qdrant_client::qdrant::{SearchPoints, PointId, Vectors, Vector, WithPayloadSelector, with_payload_selector, RecommendPoints};
use tokio::runtime::Runtime;

use async_trait::async_trait;

#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct QdrantPayload {
    pub content: String,
    pub recall: f32,
    pub recency: f32
}

impl QdrantPayload {
    pub fn new(content: String, recall: f32, recency: f32) -> Self {
        Self { content, recall, recency }
    }

    pub fn to_memory_map(&self) -> Result<HashMap<String, Value>, serde_json::Error> {
        let serialized_struct = serde_json::to_string(self)?;

        let memory_map: HashMap<String, Value> = serde_json::from_str(&serialized_struct)?;

        Ok(memory_map)
    }
}

pub struct QdrantMemorySystem {
    client: QdrantClient,
    latest_point_id: Arc<Mutex<Option<u64>>>,
    collection_name: String
}

#[async_trait]
impl MemorySystem for QdrantMemorySystem {
    as
    
    async fn store_memory(&mut self, llm: &LLM, memory: &str) -> Result<(), Box<dyn Error>> {
        let embedding = llm.model.get_base_embed(memory).await?;

        let memory_struct = Memory {
            content: memory.to_string(),
            recency: 1.0,
            recall: 1.0,
            embedding: embedding.clone(),
        };

        let payload = QdrantPayload::new(
            memory_struct.content.clone(),
            memory_struct.recency,
            memory_struct.recall
        );

        let mut latest_point_id = self.latest_point_id.lock().await;
        let point_id_val = match *latest_point_id {
            Some(id) => id + 1,
            None => 1,
        };
        *latest_point_id = Some(point_id_val);

        let point_id = PointId {
            point_id_options: Some(point_id::PointIdOptions::Num(point_id_val)),
        };
        
        let vectors = Vectors {
            vectors_options: Some(VectorsOptions::Vector(Vector {
                data: embedding.clone(),
            })),
        };

        self.client
        .upsert_points(
            self.collection_name.to_string(),
            vec![PointStruct {
                id: Some(point_id),
                payload: payload.to_memory_map()?,
                vectors: Some(vectors)
            }],
            None,
        )
        .await?;

        Ok(())
    }