Skip to main content

Adr

Struct Adr 

Source
pub struct Adr {
Show 13 fields pub number: u32, pub title: String, pub date: Date, pub status: AdrStatus, pub links: Vec<AdrLink>, pub decision_makers: Vec<String>, pub consulted: Vec<String>, pub informed: Vec<String>, pub tags: Vec<String>, pub context: String, pub decision: String, pub consequences: String, pub path: Option<PathBuf>,
}
Expand description

An Architecture Decision Record.

Fields§

§number: u32

The ADR number (e.g., 1, 2, 3).

§title: String

The title of the decision.

§date: Date

The date the decision was made.

§status: AdrStatus

The current status of the decision.

§links: Vec<AdrLink>

Links to other ADRs.

§decision_makers: Vec<String>

People who made the decision (MADR 4.0.0).

§consulted: Vec<String>

People consulted for input (MADR 4.0.0). Two-way communication - their opinions are sought.

§informed: Vec<String>

People kept informed (MADR 4.0.0). One-way communication - they are kept up-to-date.

§tags: Vec<String>

Tags for categorization.

§context: String

The context section (why this decision was needed).

§decision: String

The decision section (what was decided).

§consequences: String

The consequences section (what happens as a result).

§path: Option<PathBuf>

Path to the ADR file (not serialized to frontmatter).

Implementations§

Source§

impl Adr

Source

pub fn new(number: u32, title: impl Into<String>) -> Self

Create a new ADR with the given number and title.

Source

pub fn filename(&self) -> String

Returns the formatted filename for this ADR.

Source

pub fn full_title(&self) -> String

Returns the full title with number prefix (e.g., “1. Use Rust”).

Add a link to another ADR.

Source

pub fn set_status(&mut self, status: AdrStatus)

Set the status and optionally record what this supersedes.

Source

pub fn set_decision_makers(&mut self, makers: Vec<String>)

Set the decision makers (MADR 4.0.0).

Source

pub fn add_decision_maker(&mut self, maker: impl Into<String>)

Add a decision maker (MADR 4.0.0).

Source

pub fn set_consulted(&mut self, consulted: Vec<String>)

Set the consulted people (MADR 4.0.0).

Source

pub fn add_consulted(&mut self, person: impl Into<String>)

Add a consulted person (MADR 4.0.0).

Source

pub fn set_informed(&mut self, informed: Vec<String>)

Set the informed people (MADR 4.0.0).

Source

pub fn add_informed(&mut self, person: impl Into<String>)

Add an informed person (MADR 4.0.0).

Source

pub fn set_tags(&mut self, tags: Vec<String>)

Set the tags for categorization.

Source

pub fn add_tag(&mut self, tag: impl Into<String>)

Add a tag for categorization.

Trait Implementations§

Source§

impl Clone for Adr

Source§

fn clone(&self) -> Adr

Returns a duplicate 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 Adr

Source§

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

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

impl<'de> Deserialize<'de> for Adr

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 From<&Adr> for JsonAdr

Source§

fn from(adr: &Adr) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Adr

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Adr

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 Eq for Adr

Source§

impl StructuralPartialEq for Adr

Auto Trait Implementations§

§

impl Freeze for Adr

§

impl RefUnwindSafe for Adr

§

impl Send for Adr

§

impl Sync for Adr

§

impl Unpin for Adr

§

impl UnwindSafe for Adr

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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,

Source§

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>,

Source§

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>,

Source§

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>,