pub(crate) trait Node: Clone {
// Required methods
fn adopt(&mut self, key: &str, source: &Self);
fn adopt_shell(&mut self, key: &str, source: &Self);
fn child(&self, key: &str) -> Option<&Self>;
fn child_mut(&mut self, key: &str) -> Option<&mut Self>;
fn is_container(&self) -> bool;
fn keys(&self) -> impl Iterator<Item = &str> + '_;
fn remove(&mut self, key: &str);
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
A node of a format’s document tree that the merge can edit in place.
Required Methods§
Sourcefn adopt(&mut self, key: &str, source: &Self)
fn adopt(&mut self, key: &str, source: &Self)
Take the child key from source, replacing the existing child or
appending. An existing child keeps its decor unless the desired child
brings a comment of its own, which replaces the leading comment.
Sourcefn adopt_shell(&mut self, key: &str, source: &Self)
fn adopt_shell(&mut self, key: &str, source: &Self)
Insert an empty container for the child key of source, with the
decor and comment of that child.
fn child(&self, key: &str) -> Option<&Self>
fn child_mut(&mut self, key: &str) -> Option<&mut Self>
Sourcefn is_container(&self) -> bool
fn is_container(&self) -> bool
Whether this node holds keyed children.
fn remove(&mut self, key: &str)
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".