Skip to main content

rewrite_value

Function rewrite_value 

Source
pub fn rewrite_value<T: Serialize + DeserializeOwned>(
    with: &dyn Rewrite,
    at: &Place<'_>,
    key: &str,
    item: &mut T,
) -> Result<bool, Error>
Expand description

item mapped through with by its serde form, as a JSON value of a file is (Rewrite::value at at, under key): whether it changed. How a host or a plugin maps what it keeps of a rewritten session, such as a copy of a tool call held in memory.

ยงErrors

When the mapped form no longer reads as a T; item is left as it was, and the owner drops it or keeps it unreadable to no one.