Struct git_cliff_core::changelog::Changelog
source · pub struct Changelog<'a> {
pub releases: Vec<Release<'a>>,
/* private fields */
}
Expand description
Changelog generator.
Fields§
§releases: Vec<Release<'a>>
Releases that the changelog will contain.
Implementations§
source§impl<'a> Changelog<'a>
impl<'a> Changelog<'a>
sourcepub fn new(releases: Vec<Release<'a>>, config: &'a Config) -> Result<Self>
pub fn new(releases: Vec<Release<'a>>, config: &'a Config) -> Result<Self>
Constructs a new instance.
sourcepub fn add_context(
&mut self,
key: impl Into<String>,
value: impl Serialize
) -> Result<()>
pub fn add_context( &mut self, key: impl Into<String>, value: impl Serialize ) -> Result<()>
Adds a key value pair to the template context.
These values will be used when generating the changelog.
§Errors
This operation fails if the deserialization fails.
sourcepub fn bump_version(&mut self) -> Result<Option<String>>
pub fn bump_version(&mut self) -> Result<Option<String>>
Increments the version for the unreleased changes based on semver.
sourcepub fn generate<W: Write>(&self, out: &mut W) -> Result<()>
pub fn generate<W: Write>(&self, out: &mut W) -> Result<()>
Generates the changelog and writes it to the given output.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Changelog<'a>
impl<'a> !RefUnwindSafe for Changelog<'a>
impl<'a> Send for Changelog<'a>
impl<'a> Sync for Changelog<'a>
impl<'a> Unpin for Changelog<'a>
impl<'a> !UnwindSafe for Changelog<'a>
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> 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