pub enum VersionedFile {
Show 13 variants
Cargo(Cargo),
CargoLock(CargoLock),
PubSpec(PubSpec),
Gleam(Gleam),
GoMod(GoMod),
PackageJson(PackageJson),
PackageLockJson(PackageLockJson),
PyProject(PyProject),
MavenPom(MavenPom),
TauriConf(TauriConfJson),
TauriMacosConf(TauriConfJson),
TauriWindowsConf(TauriConfJson),
TauriLinuxConf(TauriConfJson),
}
Variants§
Cargo(Cargo)
CargoLock(CargoLock)
PubSpec(PubSpec)
Gleam(Gleam)
GoMod(GoMod)
PackageJson(PackageJson)
PackageLockJson(PackageLockJson)
PyProject(PyProject)
MavenPom(MavenPom)
TauriConf(TauriConfJson)
TauriMacosConf(TauriConfJson)
TauriWindowsConf(TauriConfJson)
TauriLinuxConf(TauriConfJson)
Implementations§
Source§impl VersionedFile
impl VersionedFile
Sourcepub fn new<S: AsRef<str> + Debug>(
config: &Config,
content: String,
git_tags: &[S],
) -> Result<Self, Error>
pub fn new<S: AsRef<str> + Debug>( config: &Config, content: String, git_tags: &[S], ) -> Result<Self, Error>
Create a new VersionedFile
§Errors
Depends on the format. If the content doesn’t match the expected format, an error is returned.
pub fn path(&self) -> &RelativePathBuf
Sourcepub fn version(&self) -> Result<Version, Error>
pub fn version(&self) -> Result<Version, Error>
Get the package version from the file.
§Errors
If there’s no package version for this type of file (e.g., lock file, dependency file).
pub fn write(self) -> Option<impl IntoIterator<Item = Action>>
Trait Implementations§
Source§impl Clone for VersionedFile
impl Clone for VersionedFile
Source§fn clone(&self) -> VersionedFile
fn clone(&self) -> VersionedFile
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 moreAuto Trait Implementations§
impl Freeze for VersionedFile
impl RefUnwindSafe for VersionedFile
impl Send for VersionedFile
impl Sync for VersionedFile
impl Unpin for VersionedFile
impl UnwindSafe for VersionedFile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more