pub enum RuleTarget {
Path(PathBuf),
Managed {
local: PathBuf,
remote: String,
poll_interval_secs: Option<u64>,
push_url: Option<String>,
},
}Expand description
Where a rule’s replacement content lives.
A rule’s target is either a plain local path (the classic string
form, a plain redirect) or a struct describing a remote-backed
managed file: the mod declares what the file is and where its
fresh content comes from, and the proxy DLL’s generic managed-file
engine takes over from there, no per-mod special-casing inside the
DLL.
"target": ".supreme/mods/mymod/data/file.txt" // classic
"target": { // managed
"local": ".supreme/mods/mymod/high_times/file.txt",
"remote": "https://host/ssbz/index.php?action=room_high_times_file&id=${room}",
"poll_interval_secs": 10,
"push_url": "https://host/ssbz/index.php?action=room_high_times_file&id=${room}"
}Variants§
Path(PathBuf)
Plain local redirect target, the original, classic form. Relative paths are interpreted against the game root (joined at resolver load), exactly as before.
Managed
Remote-backed managed file. local is the physical file the
redirect serves (and the only thing the redirect machinery ever
touches); remote is the URL whose body IS the file content (a
plain HTTP GET, response bytes used verbatim); poll_interval_secs
is the auto-refresh cadence once the game has accessed the file at
least once, None/absent means no polling (fetch only on access);
push_url is where every game write of the file is POSTed to
None/absent means the file is fetch-only (writes stay
local and are never uploaded).
All three strings (local, remote, push_url) go through the
same ${...} interpolation as every other rule string, so a mod can
wire selection-driven values (${tournament_room_id},
${url_encode(tournament_player)}, …) into the URLs. remote and
push_url routinely name the same endpoint (GET = fetch the
canonical content, POST = push a game-written file), the two
properties exist so a mod author can split the directions across
different URLs when their backend wants that.
Implementations§
Trait Implementations§
Source§impl Clone for RuleTarget
impl Clone for RuleTarget
Source§fn clone(&self) -> RuleTarget
fn clone(&self) -> RuleTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RuleTarget
impl Debug for RuleTarget
Source§impl<'de> Deserialize<'de> for RuleTarget
impl<'de> Deserialize<'de> for RuleTarget
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>,
Source§impl PartialEq for RuleTarget
impl PartialEq for RuleTarget
Source§fn eq(&self, other: &RuleTarget) -> bool
fn eq(&self, other: &RuleTarget) -> bool
self and other values to be equal, and is used by ==.