mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-09 14:28:53 +08:00
Add export support
This commit is contained in:
23
src/scripts/base.rs
Normal file
23
src/scripts/base.rs
Normal 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>>;
|
||||
}
|
||||
Reference in New Issue
Block a user