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: StringScript name
script_type: ScriptTypeScript type: Daemon/OneShot
hooks: Box<[String]>The hooks that the script wants to listen to
version_requirement: VersionReqThe version requirement of the program that the script will run against
Implementations§
Source§impl ScriptInfo
impl ScriptInfo
Sourcepub 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
Sourcepub fn into_ffi_data(self) -> FFiData
pub fn into_ffi_data(self) -> FFiData
Serialize ScriptInfo into FFiData
This is needed for writing ScriptType::DynamicLib scripts
Trait Implementations§
Source§impl Debug for ScriptInfo
impl Debug for ScriptInfo
Source§impl<'de> Deserialize<'de> for ScriptInfo
impl<'de> Deserialize<'de> for ScriptInfo
Source§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
Auto Trait Implementations§
impl Freeze for ScriptInfo
impl RefUnwindSafe for ScriptInfo
impl Send for ScriptInfo
impl Sync for ScriptInfo
impl Unpin for ScriptInfo
impl UnwindSafe for ScriptInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more