pub trait Rewrite: Send + Sync {
// Provided methods
fn message(&self, at: &Place<'_>, message: &mut Message) -> bool { ... }
fn aside(&self, at: &Place<'_>, aside: &mut Aside) -> bool { ... }
fn value(&self, at: &Place<'_>, key: &str, value: &mut Value) -> bool { ... }
fn text(&self, at: &Place<'_>, text: &mut String) -> bool { ... }
fn file(&self, name: &str, bytes: &mut Vec<u8>) -> bool { ... }
}Expand description
A change applied to every value a session keeps. Each hook edits its
argument in place and returns whether it changed anything. Every hook
defaults to no change, except file, which sends JSON
files to value, JSON-lines files line by line, and
other UTF-8 to text. A hook cannot add, drop or re-kind
a record. Shared between owners, so it takes &self.
Provided Methods§
Sourcefn message(&self, at: &Place<'_>, message: &mut Message) -> bool
fn message(&self, at: &Place<'_>, message: &mut Message) -> bool
A message of a push, a splice or a reset. Images are as stored:
blob:<sha256>.<ext> in a push or a splice, inline in a reset;
inline data put in a push or a splice is stored as a blob.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".