pub struct VersionFile<'context> { /* private fields */ }Expand description
Reads and writes version files for a Git context.
Implementations§
Source§impl<'context> VersionFile<'context>
impl<'context> VersionFile<'context>
Sourcepub const fn new(context: &'context GitContext) -> Self
pub const fn new(context: &'context GitContext) -> Self
Creates a version-file accessor.
Sourcepub fn is_version_defined(&self) -> Result<bool>
pub fn is_version_defined(&self) -> Result<bool>
Returns whether a version file is defined at the context’s selected commit.
Sourcepub fn get_version(
&self,
requirements: VersionFileRequirements,
) -> Result<(Option<VersionOptions>, VersionFileLocations)>
pub fn get_version( &self, requirements: VersionFileRequirements, ) -> Result<(Option<VersionOptions>, VersionFileLocations)>
Reads from the selected Git commit, or from disk when no commit is selected.
Sourcepub fn get_working_copy_version(
&self,
requirements: VersionFileRequirements,
) -> Result<(Option<VersionOptions>, VersionFileLocations)>
pub fn get_working_copy_version( &self, requirements: VersionFileRequirements, ) -> Result<(Option<VersionOptions>, VersionFileLocations)>
Reads version files from the working copy, including uncommitted changes.
Sourcepub fn set_version(
&self,
project_directory: impl AsRef<Path>,
version: &VersionOptions,
include_schema_property: bool,
) -> Result<PathBuf>
pub fn set_version( &self, project_directory: impl AsRef<Path>, version: &VersionOptions, include_schema_property: bool, ) -> Result<PathBuf>
Writes version.json, or preserves an existing version.txt when it can represent
all the supplied options.
Auto Trait Implementations§
impl<'context> !Send for VersionFile<'context>
impl<'context> !Sync for VersionFile<'context>
impl<'context> Freeze for VersionFile<'context>
impl<'context> RefUnwindSafe for VersionFile<'context>
impl<'context> Unpin for VersionFile<'context>
impl<'context> UnsafeUnpin for VersionFile<'context>
impl<'context> UnwindSafe for VersionFile<'context>
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