Skip to main content

PatchOptions

Struct PatchOptions 

Source
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

Source§

fn clone(&self) -> PatchOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PatchOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PatchOptions

Source§

fn default() -> PatchOptions

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PatchOptions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PatchOptions

Source§

fn eq(&self, other: &PatchOptions) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for PatchOptions

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PatchOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.