Struct rscript::ScriptInfo
source[−]pub struct ScriptInfo {
pub name: String,
pub script_type: ScriptType,
pub hooks: Box<[String]>,
pub version_requirement: VersionReq,
}
Expand description
Script metadata that every script should send to the main_crate when starting up
Fields
name: String
Script name
script_type: ScriptType
Script type: Daemon/OneShot
hooks: Box<[String]>
The hooks that the script wants to listen to
version_requirement: VersionReq
The version requirement of the program that the script will run against
Implementations
pub fn new(
name: &'static str,
script_type: ScriptType,
hooks: &'static [&'static str],
version_requirement: VersionReq
) -> Self
pub fn new(
name: &'static str,
script_type: ScriptType,
hooks: &'static [&'static str],
version_requirement: VersionReq
) -> Self
Create a new script metadata, the new constructor tries to add more ergonomics
Serialize ScriptInfo
into FFiData
This is needed for writing ScriptType::DynamicLib scripts
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more