#[non_exhaustive]pub struct Changelog {
pub format: Format,
pub metadata: Metadata,
pub releases: Vec<Release>,
pub links: Vec<LinkDefinition>,
pub source: String,
}Expand description
An owned, serializable changelog independent of its source format.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.format: FormatSource format, retained so validation uses the correct conventions. Defaults to Keep a Changelog when reading older serialized models.
metadata: MetadataTitle and introductory Markdown.
releases: Vec<Release>All releases, including pending releases, in original document order.
links: Vec<LinkDefinition>Document-wide reference definitions in source order.
Independently decoded bodies keep their definitions in Release::links.
source: StringExact input, including whitespace, duplicate definitions, and line endings. Defaults to empty when deserializing CLI exports, which omit this field. Spans still refer to the original input when the source copy is absent.
Implementations§
Source§impl Changelog
impl Changelog
Sourcepub fn new(format: Format) -> Self
pub fn new(format: Format) -> Self
Create an empty document of the given format, without source text.
use logloom::{Changelog, Format, Release};
let mut changelog = Changelog::new(Format::GenericMarkdown);
changelog.releases.push(Release::new(Some("preview".into())));
assert_eq!(changelog.releases.len(), 1);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Changelog
impl<'de> Deserialize<'de> for Changelog
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Changelog
impl StructuralPartialEq for Changelog
Auto Trait Implementations§
impl Freeze for Changelog
impl RefUnwindSafe for Changelog
impl Send for Changelog
impl Sync for Changelog
impl Unpin for Changelog
impl UnsafeUnpin for Changelog
impl UnwindSafe for Changelog
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