pub struct Package {
pub name: Name,
pub versions: PackageVersions,
pub release_notes: ReleaseNotes,
/* private fields */
}Fields§
§name: Name§versions: PackageVersions§release_notes: ReleaseNotesImplementations§
Source§impl Package
impl Package
Sourcepub fn new<S: AsRef<str> + Debug>(
name: Name,
git_tags: &[S],
versioned_files_tracked: Vec<Config>,
all_versioned_files: &[VersionedFile],
release_notes: ReleaseNotes,
scopes: Option<Vec<String>>,
) -> Result<Self, Box<NewError>>
pub fn new<S: AsRef<str> + Debug>( name: Name, git_tags: &[S], versioned_files_tracked: Vec<Config>, all_versioned_files: &[VersionedFile], release_notes: ReleaseNotes, scopes: Option<Vec<String>>, ) -> Result<Self, Box<NewError>>
Try and combine a bunch of versioned files into one logical package.
§Errors
There must be at least one versioned file, and all files must have the same version.
Sourcepub fn bump_version(
&mut self,
bump: Bump,
go_versioning: GoVersioning,
versioned_files: Vec<VersionedFile>,
) -> Result<Vec<VersionedFile>, BumpError>
pub fn bump_version( &mut self, bump: Bump, go_versioning: GoVersioning, versioned_files: Vec<VersionedFile>, ) -> Result<Vec<VersionedFile>, BumpError>
Returns the actions that must be taken to set this package to the new version, along with the version it was set to.
The version can either be calculated from a semver rule or specified manually.
§Errors
If the file is a go.mod, there are rules about what versions are allowed.
If serialization of some sort fails, which is a bug, then this will return an error.
If the Rule::Release is specified, but there is no current prerelease, that’s an
error too.
pub fn get_changes( &self, changeset: &[Release], commit_messages: &[String], ) -> Vec<Change>
Sourcepub fn apply_changes(
&mut self,
changes: &[Change],
versioned_files: Vec<VersionedFile>,
config: ChangeConfig,
) -> Result<(Vec<VersionedFile>, Vec<Action>), BumpError>
pub fn apply_changes( &mut self, changes: &[Change], versioned_files: Vec<VersionedFile>, config: ChangeConfig, ) -> Result<(Vec<VersionedFile>, Vec<Action>), BumpError>
Apply changes to the package, updating the internal version and returning the list of actions to take to complete the changes.
§Errors
If the file is a go.mod, there are rules about what versions are allowed.
If serialization of some sort fails, which is a bug, then this will return an error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnwindSafe for Package
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
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>
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>
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