Struct unclog::Config

source ·
pub struct Config {
Show 14 fields pub maybe_project_url: Option<Url>, pub change_template: String, pub wrap: u16, pub heading: String, pub bullet_style: BulletStyle, pub empty_msg: String, pub prologue_filename: String, pub epilogue_filename: String, pub sort_releases_by: ReleaseSortingConfig, pub release_date_formats: ReleaseDateFormats, pub unreleased: UnreleasedConfig, pub change_sets: ChangeSetsConfig, pub change_set_sections: ChangeSetSectionsConfig, pub components: ComponentsConfig,
}
Expand description

Configuration options relating to the generation of a changelog.

Fields§

§maybe_project_url: Option<Url>

The URL of the project. This helps facilitate automatic content generation when supplying an issue or PR number.

§change_template: String

The path to a file containing the change template to use when automatically adding new changelog entries. Relative to the .changelog folder.

§wrap: u16

Wrap entries automatically to a specific number of characters per line.

§heading: String

The heading to use at the beginning of the changelog we generate.

§bullet_style: BulletStyle

What style of bullet should we use when generating changelog entries?

§empty_msg: String

The message to use when the changelog is empty.

§prologue_filename: String

The filename (relative to the .changelog folder) of the file containing content to be inserted at the beginning of the generated changelog.

§epilogue_filename: String

The filename (relative to the .changelog folder) of the file containing content to be appended to the end of the generated changelog.

§sort_releases_by: ReleaseSortingConfig

Sort releases by the given properties.

§release_date_formats: ReleaseDateFormats

An ordered list of possible formats to expect when parsing release summaries to establish release dates.

§unreleased: UnreleasedConfig

Configuration relating to unreleased changelog entries.

§change_sets: ChangeSetsConfig

Configuration relating to sets of changes.

§change_set_sections: ChangeSetSectionsConfig

Configuration relating to change set sections.

§components: ComponentsConfig

Configuration relating to components/submodules.

Implementations§

source§

impl Config

source

pub fn read_from_file<P: AsRef<Path>>(path: P) -> Result<Self>

Attempt to read the configuration from the given file.

If the given file does not exist, this method does not fail: it returns a Config object with all of the default values set.

At present, only TOML format is supported.

source

pub fn write_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>

Attempt to save the configuration to the given file.

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for Config

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Config

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for Config

source§

fn eq(&self, other: &Config) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Config

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Config

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,