Move internal message struct out from lib file

This commit is contained in:
Filip Tibell 2023-02-09 23:28:12 +01:00
parent f3cb4f2ce0
commit 3073fb8fec
No known key found for this signature in database
6 changed files with 14 additions and 14 deletions

View file

@ -14,10 +14,10 @@ use reqwest::{ClientBuilder, Method};
use tokio::{sync::mpsc::Sender, task};
use crate::utils::{
message::LuneMessage,
net::{get_request_user_agent_header, NetClient},
table::TableBuilder,
};
use crate::LuneMessage;
pub fn create(lua: &Lua) -> LuaResult<()> {
// Create a reusable client for performing our

View file

@ -11,7 +11,7 @@ use crate::{
create_fs, create_net, create_process, create_require, create_stdio, create_task,
create_top_level,
},
utils::formatting::pretty_format_luau_error,
utils::{formatting::pretty_format_luau_error, message::LuneMessage},
};
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
@ -39,14 +39,6 @@ impl LuneGlobal {
}
}
#[derive(Debug)]
pub(crate) enum LuneMessage {
Exit(u8),
Spawned,
Finished,
LuaError(LuaError),
}
#[derive(Clone, Debug, Default)]
pub struct Lune {
globals: HashSet<LuneGlobal>,

View file

@ -0,0 +1,9 @@
use mlua::prelude::*;
#[derive(Debug, Clone)]
pub enum LuneMessage {
Exit(u8),
Spawned,
Finished,
LuaError(LuaError),
}

View file

@ -1,5 +1,6 @@
pub mod formatting;
pub mod futures;
pub mod message;
pub mod net;
pub mod process;
pub mod table;

View file

@ -3,9 +3,7 @@ use std::{process::ExitStatus, sync::Weak, time::Duration};
use mlua::prelude::*;
use tokio::{io, process::Child, sync::mpsc::Sender, task::spawn, time::sleep};
use crate::LuneMessage;
use super::futures::AsyncTeeWriter;
use crate::utils::{futures::AsyncTeeWriter, message::LuneMessage};
pub async fn pipe_and_inherit_child_process_stdio(
mut child: Child,

View file

@ -6,7 +6,7 @@ use mlua::prelude::*;
use tokio::sync::mpsc::Sender;
use tokio::task;
use crate::LuneMessage;
use crate::utils::message::LuneMessage;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum TaskRunMode {