mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 13:00:37 +00:00
Move internal message struct out from lib file
This commit is contained in:
parent
f3cb4f2ce0
commit
3073fb8fec
6 changed files with 14 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -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>,
|
||||
|
|
9
packages/lib/src/utils/message.rs
Normal file
9
packages/lib/src/utils/message.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
use mlua::prelude::*;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum LuneMessage {
|
||||
Exit(u8),
|
||||
Spawned,
|
||||
Finished,
|
||||
LuaError(LuaError),
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
pub mod formatting;
|
||||
pub mod futures;
|
||||
pub mod message;
|
||||
pub mod net;
|
||||
pub mod process;
|
||||
pub mod table;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue