Add export support

This commit is contained in:
2025-05-20 17:47:04 +08:00
commit e2e7399832
15 changed files with 1819 additions and 0 deletions

23
src/scripts/base.rs Normal file
View File

@@ -0,0 +1,23 @@
use crate::types::*;
use anyhow::Result;
pub trait ScriptBuilder {
fn default_encoding(&self) -> Encoding;
fn build_script(
&self,
filename: &str,
encoding: Encoding,
config: &ExtraConfig,
) -> Result<Box<dyn Script>>;
fn extensions(&self) -> &'static [&'static str];
fn script_type(&self) -> &'static ScriptType;
}
pub trait Script: std::fmt::Debug {
fn default_output_script_type(&self) -> OutputScriptType;
fn extract_messages(&self) -> Result<Vec<Message>>;
}