pub struct JsoncHandler { /* private fields */ }Expand description
Handler for JSONC file operations.
Currently parses JSONC and strips comments for serde deserialization. Full comment-preserving round-trip editing will require upgrading the jsonc-parser version or implementing custom CST handling.
Implementations§
Source§impl JsoncHandler
impl JsoncHandler
Sourcepub fn to_json_string(&self) -> Result<String>
pub fn to_json_string(&self) -> Result<String>
Extract clean JSON from the JSONC source (strips comments and trailing commas).
Sourcepub fn write_file(&self, path: &Path) -> Result<()>
pub fn write_file(&self, path: &Path) -> Result<()>
Write the JSONC content back to a file. For now, this writes the original source (preserving comments in existing files).
Auto Trait Implementations§
impl Freeze for JsoncHandler
impl RefUnwindSafe for JsoncHandler
impl Send for JsoncHandler
impl Sync for JsoncHandler
impl Unpin for JsoncHandler
impl UnsafeUnpin for JsoncHandler
impl UnwindSafe for JsoncHandler
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