Struct unclog::Changelog[][src]

pub struct Changelog {
    pub unreleased: Option<ChangeSet>,
    pub releases: Vec<Release>,
    pub epilogue: Option<String>,
}
Expand description

A log of changes for a specific project.

Fields

unreleased: Option<ChangeSet>

Unreleased changes don’t have version information associated with them.

releases: Vec<Release>

An ordered list of releases’ changes.

epilogue: Option<String>

Any additional content that must appear at the end of the changelog (e.g. historical changelog content prior to switching to unclog).

Implementations

impl Changelog[src]

pub fn is_empty(&self) -> bool[src]

Checks whether this changelog is empty.

pub fn init_dir<P: AsRef<Path>, E: AsRef<Path>>(
    path: P,
    epilogue_path: Option<E>
) -> Result<()>
[src]

Initialize a new (empty) changelog in the given path.

Creates the target folder if it doesn’t exist, and optionally copies an epilogue into it.

pub fn read_from_dir<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Attempt to read a full changelog from the given directory.

pub fn add_unreleased_entry<P, S, I, C>(
    path: P,
    section: S,
    id: I,
    content: C
) -> Result<()> where
    P: AsRef<Path>,
    S: AsRef<str>,
    I: AsRef<str>,
    C: AsRef<str>, 
[src]

Adds a changelog entry with the given ID to the specified section in the unreleased folder.

pub fn get_entry_path<P, R, S, I>(
    path: P,
    release: R,
    section: S,
    id: I
) -> PathBuf where
    P: AsRef<Path>,
    R: AsRef<str>,
    S: AsRef<str>,
    I: AsRef<str>, 
[src]

Compute the file system path to the entry with the given parameters.

pub fn prepare_release_dir<P: AsRef<Path>, S: AsRef<str>>(
    path: P,
    version: S
) -> Result<()>
[src]

Moves the unreleased folder from our changelog to a directory whose name is the given version.

Trait Implementations

impl Clone for Changelog[src]

fn clone(&self) -> Changelog[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Changelog[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Display for Changelog[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.