pub(crate) struct Json {
dialect: Dialect,
}Expand description
Reconciles JSON or JSON5 documents through the syntax tree.
Fields§
§dialect: DialectImplementations§
Trait Implementations§
Source§impl Backend for Json
impl Backend for Json
type Document = Document
Source§fn parse(&self, source: &str) -> Result<Document, DocumentError>
fn parse(&self, source: &str) -> Result<Document, DocumentError>
Parse an existing source document. Read more
Source§fn build(&self, desired: &Annotated) -> Result<Document, DocumentError>
fn build(&self, desired: &Annotated) -> Result<Document, DocumentError>
Build the desired document from its annotated value. Read more
Source§fn string_leaf(&self, node: &Value) -> Result<Option<String>, DocumentError>
fn string_leaf(&self, node: &Value) -> Result<Option<String>, DocumentError>
Source§fn finish(&self, current: &mut Document, desired: &Document, existing: Existing)
fn finish(&self, current: &mut Document, desired: &Document, existing: Existing)
Adjust the merged document before it is rendered.
Source§fn descend<'n>(
&self,
node: &'n <<Self as Backend>::Document as Editable>::Node,
key: &str,
_path: &[String],
) -> Result<Option<&'n <<Self as Backend>::Document as Editable>::Node>, DocumentError>
fn descend<'n>( &self, node: &'n <<Self as Backend>::Document as Editable>::Node, key: &str, _path: &[String], ) -> Result<Option<&'n <<Self as Backend>::Document as Editable>::Node>, 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: &Self::Document, error: MergeError) -> DocumentError
fn explain(&self, _current: &Self::Document, 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 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 Json
Auto Trait Implementations§
impl Freeze for Json
impl RefUnwindSafe for Json
impl Send for Json
impl Sync for Json
impl Unpin for Json
impl UnsafeUnpin for Json
impl UnwindSafe for Json
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