pub struct PatchOptions {
pub id: Option<String>,
pub insert: Option<Vec<EntryOptions>>,
pub name: Option<String>,
pub config: Option<Node>,
pub disabled: Option<bool>,
pub inject: Option<Vec<String>>,
pub extra: IndexMap<String, Node>,
}Expand description
One patch row: insert entries, or override an existing entry by id.
Every field is optional; rows are struct-typed where upstream’s JS patches
could carry any field. Unknown keys are kept in PatchOptions::extra
(round-trip and diagnostics) and warn-skipped at application time.
Fields§
§id: Option<String>Target entry id. With insert it names the group to insert into;
without insert it selects the entry to override.
insert: Option<Vec<EntryOptions>>Entries to insert: appended to the target group’s children when id
names a group, to the top level otherwise. Some(vec![]) still takes
the insert branch (upstream truthiness); only None means “not an
insert”.
name: Option<String>Guard on the target: when present and non-empty it must equal the
target’s name or the patch warns and skips. It is never written
back — a guard, not an override.
config: Option<Node>Whole replacement of the target’s config (a replacement, not a
merge).
disabled: Option<bool>Replacement of the target’s disabled flag.
inject: Option<Vec<String>>Replacement of the target’s inject list.
extra: IndexMap<String, Node>Unknown keys, preserved in file order. Applying a patch warns and
skips them: upstream JS patches could override any field, but the
Rust entry has no slot for them (group is the children list, not
upstream’s marker; intercept/isolate are not ported).
Trait Implementations§
Source§impl Clone for PatchOptions
impl Clone for PatchOptions
Source§fn clone(&self) -> PatchOptions
fn clone(&self) -> PatchOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more