pub(crate) struct Yaml;Expand description
The YAML backend. It edits the source tree and keeps what it does not touch byte for byte.
Trait Implementations§
Source§impl Backend for Yaml
impl Backend for Yaml
Source§fn finish(&self, current: &mut Tree, desired: &Tree, existing: Existing)
fn finish(&self, current: &mut Tree, desired: &Tree, existing: Existing)
Put the generated header comment above the user’s, once.
type Document = Tree
Source§fn parse(&self, source: &str) -> Result<Tree, DocumentError>
fn parse(&self, source: &str) -> Result<Tree, DocumentError>
Parse an existing source document. Read more
Source§fn string_leaf(&self, node: &Entry) -> Result<Option<String>, DocumentError>
fn string_leaf(&self, node: &Entry) -> Result<Option<String>, DocumentError>
Source§fn descend<'n>(
&self,
node: &'n Entry,
key: &str,
path: &[String],
) -> Result<Option<&'n Entry>, DocumentError>
fn descend<'n>( &self, node: &'n Entry, key: &str, path: &[String], ) -> Result<Option<&'n Entry>, DocumentError>
The child
key of node, which sits at path. Backends fail here
when a node on the way cannot be read through. Read moreSource§fn explain(&self, current: &Tree, error: MergeError) -> DocumentError
fn explain(&self, current: &Tree, error: MergeError) -> DocumentError
The error for a merge that failed against
current. Backends can
name a cause more precisely than the generic conflict.Source§fn build(&self, desired: &Annotated) -> Result<Tree, DocumentError>
fn build(&self, desired: &Annotated) -> Result<Tree, DocumentError>
Build the desired document from its annotated value. Read more
Source§fn read_string(
&self,
source: &str,
path: &[String],
) -> Result<Option<String>, DocumentError>
fn read_string( &self, source: &str, path: &[String], ) -> Result<Option<String>, DocumentError>
impl Copy for Yaml
Auto Trait Implementations§
impl Freeze for Yaml
impl RefUnwindSafe for Yaml
impl Send for Yaml
impl Sync for Yaml
impl Unpin for Yaml
impl UnsafeUnpin for Yaml
impl UnwindSafe for Yaml
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more