pub struct JsonVersionFile;Expand description
Version file engine for package.json.
Uses serde_json for detection and reading, and a line-level regex for
writing to preserve key order and formatting.
Trait Implementations§
Source§impl Clone for JsonVersionFile
impl Clone for JsonVersionFile
Source§fn clone(&self) -> JsonVersionFile
fn clone(&self) -> JsonVersionFile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JsonVersionFile
impl Debug for JsonVersionFile
Source§impl VersionFile for JsonVersionFile
impl VersionFile for JsonVersionFile
Source§fn detect(&self, content: &str) -> bool
fn detect(&self, content: &str) -> bool
Check if
content contains a version field this engine handles.Source§fn read_version(&self, content: &str) -> Option<String>
fn read_version(&self, content: &str) -> Option<String>
Extract the current version string from file content.
Source§fn write_version(
&self,
content: &str,
new_version: &str,
) -> Result<String, VersionFileError>
fn write_version( &self, content: &str, new_version: &str, ) -> Result<String, VersionFileError>
Return updated file content with
new_version replacing the old value.impl Copy for JsonVersionFile
Auto Trait Implementations§
impl Freeze for JsonVersionFile
impl RefUnwindSafe for JsonVersionFile
impl Send for JsonVersionFile
impl Sync for JsonVersionFile
impl Unpin for JsonVersionFile
impl UnsafeUnpin for JsonVersionFile
impl UnwindSafe for JsonVersionFile
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