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: mqtt.rs
    path of file: ./repos/sn0int/src/runtime
    
    the code of the file until where you have to start completion: use crate::errors::*;

use crate::engine::ctx::State;
use crate::hlua::{self, AnyLuaValue};
use crate::mqtt::MqttOptions;
use std::sync::Arc;
use url::Url;

pub fn mqtt_connect(lua: &mut hlua::Lua, state: Arc<dyn State>) {
    lua.set("m
    
pub fn mqtt_recv(lua: &mut hlua::Lua, state: Arc<dyn State>) {
    lua.set("mqtt_recv", hlua::function1(move |sock: String| -> Result<AnyLuaValue> {
        let sock = state.get_mqtt(&sock);
        let mut sock = sock.lock().unwrap();

        let pkt = sock.recv_pkt()
            .map_err(|err| state.set_error(err))?;

        if let Some(pkt) = pkt {
            pkt.to_lua()
                .map_err(|err| state.set_error(err))
        } else {
            Ok(AnyLuaValue::LuaNil)
        }
    }))
}