pub enum LinkKind {
Supersedes,
SupersededBy,
Amends,
AmendedBy,
RelatesTo,
Custom(String),
}Expand description
The kind of link between ADRs.
Note (#323): kebab-case frontmatter forms like kind: relates-to do not
match the #[serde(rename_all = "lowercase")] names below (relatesto,
supersededby, amendedby) and deserialize into Custom instead of the
canonical variant. Mapping those forms onto the canonical variants via
serde aliases would be straightforward, but the writer serializes
canonical variants back out through the same rename_all (e.g.
RelatesTo -> "relatesto"), so accepting relates-to as RelatesTo
on read would silently rewrite it to relatesto on the next metadata
write. That conflicts with the corpus’s byte-identity goal for fixture
0007, so the kind-mapping fix is deferred; only the link-description
round-trip is fixed here.
Variants§
Supersedes
This ADR supersedes the target.
SupersededBy
This ADR is superseded by the target.
Amends
This ADR amends the target.
AmendedBy
This ADR is amended by the target.
RelatesTo
This ADR relates to the target.
Custom(String)
Custom link type (for extensibility).
Implementations§
Source§impl LinkKind
impl LinkKind
Sourcepub fn reverse(&self) -> Self
pub fn reverse(&self) -> Self
Get the reverse link kind.
For predefined link types, returns the opposite direction. For custom types, returns the same type (symmetric relation).
§Examples
use adrs_core::LinkKind;
assert_eq!(LinkKind::Supersedes.reverse(), LinkKind::SupersededBy);
assert_eq!(LinkKind::AmendedBy.reverse(), LinkKind::Amends);
assert_eq!(LinkKind::RelatesTo.reverse(), LinkKind::RelatesTo);Trait Implementations§
Source§impl<'de> Deserialize<'de> for LinkKind
impl<'de> Deserialize<'de> for LinkKind
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>,
impl Eq for LinkKind
impl StructuralPartialEq for LinkKind
Auto Trait Implementations§
impl Freeze for LinkKind
impl RefUnwindSafe for LinkKind
impl Send for LinkKind
impl Sync for LinkKind
impl Unpin for LinkKind
impl UnsafeUnpin for LinkKind
impl UnwindSafe for LinkKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.