Trait yaml_patch::Patch [−][src]
Extends a type with mutable key-value symantics, allowing it to be "patched" with runtime yaml-derived values.
Required methods
fn patch_from_value(&mut self, patch_value: &Value) -> Result<()>
[src]
Update this object to reflect the contents of a serde_yaml::Value
. The
rules are as follows:
-
If
patch_value
is not aserde_yaml::Mapping
, then it is deserialized into self, if possible. -
Otherwise, if
patch_value
is aserde_yaml::Mapping
, then each of its values are merged into their respective data members ofself
using this algorithm recursively.
Provided methods
fn patch_from_str(&mut self, yaml_str: &str) -> Result<()>
[src]
Update this object to reflect the contents of a YAML-encoded string.
fn patch_from_reader<R>(&mut self, reader: R) -> Result<()> where
R: Read,
[src]
R: Read,
Update this object to reflect the contents of a reader, which will yield a YAML-encoded string.
fn patch_from_key_val(&mut self, key_val_str: &str) -> Result<(), Error>
[src]
Update a single, possibly nested, data member within this object using
key-path style attribute access. For example, the string
"company.ceo.name = Bob"
would operate on a data member called
company
within this object, setting the name
field of the ceo
field
to "Bob"
.
Implementors
impl<T> Patch for T where
T: Serialize + for<'de> Deserialize<'de>,
[src]
T: Serialize + for<'de> Deserialize<'de>,