Struct changesets::Change

source ·
pub struct Change {
    pub unique_id: UniqueId,
    pub versioning: Versioning,
    pub summary: String,
}
Expand description

Represents a single change which is applicable to any number of packages.

Fields§

§unique_id: UniqueId

Something to uniquely identify a change.

This is the name of the file (without the .md extension) which defines this changeset.

§versioning: Versioning

Describes how a changeset affects the relevant packages.

§summary: String

The details of the change which will be written to a Changelog file

Implementations§

source§

impl Change

source

pub fn write_to_directory<T: AsRef<Path>>(&self, path: T) -> Result<PathBuf>

Create a markdown file in the provided directory with the contents of this Change.

The name of the created file will be the Change::unique_id with the .md extension— that path is returned.

Errors

If the file cannot be written, an std::io::Error is returned. This may happen if the directory does not exist.

source

pub fn from_file<T: AsRef<Path>>(path: T) -> Result<Self, LoadingError>

Load a Change from a Markdown file.

Errors
  • If the file cannot be read
  • If the file does not have a valid name (i.e. it does not end in .md)
  • If the file does not have a valid front matter
  • If the file does not have a valid versioning info in the front matter

Trait Implementations§

source§

impl Clone for Change

source§

fn clone(&self) -> Change

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 Change

source§

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

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

impl Display for Change

source§

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

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

impl FromIterator<Change> for ChangeSet

source§

fn from_iter<T: IntoIterator<Item = Change>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl PartialEq<Change> for Change

source§

fn eq(&self, other: &Change) -> 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 Eq for Change

source§

impl StructuralEq for Change

source§

impl StructuralPartialEq for Change

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.