feat: update wfassoc-exec
This commit is contained in:
@@ -6,12 +6,17 @@ pub use lowlevel::{Scope, View};
|
||||
|
||||
// region: Error Type
|
||||
|
||||
/// Error occurs in this module.
|
||||
/// Error occurs when operating with `Schema`.
|
||||
#[derive(Debug, TeError)]
|
||||
pub enum Error {}
|
||||
pub enum SchemaError {}
|
||||
|
||||
/// Result type used in this module.
|
||||
type Result<T> = std::result::Result<T, Error>;
|
||||
/// Error occurs when trying converting `Schema` into `Program`.
|
||||
#[derive(Debug, TeError)]
|
||||
pub enum ParseProgramError {}
|
||||
|
||||
/// Error occurs when operating with `Program`.
|
||||
#[derive(Debug, TeError)]
|
||||
pub enum ProgramError {}
|
||||
|
||||
// endregion
|
||||
|
||||
@@ -24,6 +29,12 @@ pub struct Schema {
|
||||
identifier: String,
|
||||
path: String,
|
||||
clsid: String,
|
||||
|
||||
name: Option<String>,
|
||||
icon: Option<String>,
|
||||
behavior: Option<String>,
|
||||
|
||||
strs: HashMap<String, String>,
|
||||
icons: HashMap<String, String>,
|
||||
behaviors: HashMap<String, String>,
|
||||
exts: HashMap<String, SchemaExt>,
|
||||
@@ -43,29 +54,33 @@ impl Schema {
|
||||
identifier: String::new(),
|
||||
path: String::new(),
|
||||
clsid: String::new(),
|
||||
name: None,
|
||||
icon: None,
|
||||
behavior: None,
|
||||
strs: HashMap::new(),
|
||||
icons: HashMap::new(),
|
||||
behaviors: HashMap::new(),
|
||||
exts: HashMap::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_identifier(&mut self, identifier: &str) -> Result<()> {
|
||||
pub fn set_identifier(&mut self, identifier: &str) -> Result<(), SchemaError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn set_path(&mut self, exe_path: &str) -> Result<()> {
|
||||
pub fn set_path(&mut self, exe_path: &str) -> Result<(), SchemaError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn set_clsid(&mut self, clsid: &str) -> Result<()> {
|
||||
pub fn set_clsid(&mut self, clsid: &str) -> Result<(), SchemaError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn add_icon(&mut self, name: &str, value: &str) -> Result<()> {
|
||||
pub fn add_icon(&mut self, name: &str, value: &str) -> Result<(), SchemaError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn add_behavior(&mut self, name: &str, value: &str) -> Result<()> {
|
||||
pub fn add_behavior(&mut self, name: &str, value: &str) -> Result<(), SchemaError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
@@ -75,11 +90,11 @@ impl Schema {
|
||||
ext_name: &str,
|
||||
ext_icon: &str,
|
||||
ext_behavior: &str,
|
||||
) -> Result<()> {
|
||||
) -> Result<(), SchemaError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn into_program(self) -> Result<Program> {
|
||||
pub fn into_program(self) -> Result<Program, ParseProgramError> {
|
||||
Program::new(self)
|
||||
}
|
||||
}
|
||||
@@ -88,7 +103,7 @@ impl Schema {
|
||||
pub struct Program {}
|
||||
|
||||
impl TryFrom<Schema> for Program {
|
||||
type Error = Error;
|
||||
type Error = ParseProgramError;
|
||||
|
||||
fn try_from(value: Schema) -> std::result::Result<Self, Self::Error> {
|
||||
Self::new(value)
|
||||
@@ -96,7 +111,7 @@ impl TryFrom<Schema> for Program {
|
||||
}
|
||||
|
||||
impl Program {
|
||||
pub fn new(schema: Schema) -> Result<Self> {
|
||||
pub fn new(schema: Schema) -> Result<Self, ParseProgramError> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user