pub struct DenoVersionFile;Expand description
Version file engine for deno.json and deno.jsonc.
Uses line-level matching to find and replace the "version" field so that
JSONC comments are preserved. The regex matches the first occurrence of
"version": "..." in the file content.
Trait Implementations§
Source§impl Clone for DenoVersionFile
impl Clone for DenoVersionFile
Source§fn clone(&self) -> DenoVersionFile
fn clone(&self) -> DenoVersionFile
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 DenoVersionFile
impl Debug for DenoVersionFile
Source§impl VersionFile for DenoVersionFile
impl VersionFile for DenoVersionFile
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 DenoVersionFile
Auto Trait Implementations§
impl Freeze for DenoVersionFile
impl RefUnwindSafe for DenoVersionFile
impl Send for DenoVersionFile
impl Sync for DenoVersionFile
impl Unpin for DenoVersionFile
impl UnsafeUnpin for DenoVersionFile
impl UnwindSafe for DenoVersionFile
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