pub struct WinScript {
pub name: &'static str,
pub body: &'static str,
pub params: Value,
}Expand description
One fixed script and its parameters.
Fields§
§name: &'static strA short name for error messages.
body: &'static strThe script body, a const. It reads its parameters from $p and ends
by calling E with the result.
params: ValueThe parameters: a JSON object (or Null for none), decoded in-script.
Implementations§
Source§impl WinScript
impl WinScript
Sourcepub fn move_replace(src: &str, dst: &str) -> WinScript
pub fn move_replace(src: &str, dst: &str) -> WinScript
The script that replaces dst with src (MOVE_REPLACE).
Sourcepub fn record_replace(src: &str, dst: &str, retries: u32) -> WinScript
pub fn record_replace(src: &str, dst: &str, retries: u32) -> WinScript
The script that atomically replaces the release record dst with
src (RECORD_REPLACE). retries is how often a sharing violation
is retried; like both paths it travels only in the JSON parameters.
Sourcepub fn git_entry(projects_dir: &str, project_dir: &str, git: &str) -> WinScript
pub fn git_entry(projects_dir: &str, project_dir: &str, git: &str) -> WinScript
The script that probes the .git entry of one project (GIT_ENTRY).
The three native paths are <data>\projects, the project directory and
its .git; they travel only as parameters.
Sourcepub fn enumerate(prefix: &str, roots: &[String]) -> WinScript
pub fn enumerate(prefix: &str, roots: &[String]) -> WinScript
The script that walks roots with prefix in front of each
(ENUMERATE). prefix is LONG_PATH_PREFIX on a Windows host.
Sourcepub fn enumerate_children(prefix: &str, roots: &[String]) -> WinScript
pub fn enumerate_children(prefix: &str, roots: &[String]) -> WinScript
The script that lists the direct children of roots with prefix in
front of each (ENUMERATE_CHILDREN); its result parses with
parse_enumeration.
Sourcepub fn bundle(
prefix: &str,
resources: &str,
list: &str,
archive: &str,
list_sha256: &str,
need: u64,
) -> WinScript
pub fn bundle( prefix: &str, resources: &str, list: &str, archive: &str, list_sha256: &str, need: u64, ) -> WinScript
The script that zips exactly the files of the uploaded list list
(native paths below resources) into archive (BUNDLE).
list_sha256 is the lowercase hex SHA-256 of the list bytes, need
the free bytes the archive’s drive must have. Every value travels only
in the JSON parameters.
Sourcepub fn bundle_clean(prefix: &str, dir: &str, names: &[&str]) -> WinScript
pub fn bundle_clean(prefix: &str, dir: &str, names: &[&str]) -> WinScript
The script that removes the files names and then the staging dir
dir (native) (BUNDLE_CLEAN).