pub struct AttrEntry {
pub key: String,
pub value: NixExpr,
pub comment: Vec<String>,
pub blank_above: bool,
}Expand description
One key/value pair in an attribute set, with optional preceding-line comment block. Comments document intent without leaking into the structural shape.
Fields§
§key: String§value: NixExpr§comment: Vec<String>Comment lines emitted ABOVE the entry. Each string becomes
one # … line. Empty vec = no comment.
blank_above: boolForce a blank line above this entry even when no comment is present — used by renderers like the Nord palette to visually group sibling attribute sets.
Implementations§
Source§impl AttrEntry
impl AttrEntry
pub fn new(key: impl Into<String>, value: NixExpr) -> Self
pub fn with_comment( self, lines: impl IntoIterator<Item = impl Into<String>>, ) -> Self
pub fn with_blank_above(self) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AttrEntry
impl RefUnwindSafe for AttrEntry
impl Send for AttrEntry
impl Sync for AttrEntry
impl Unpin for AttrEntry
impl UnsafeUnpin for AttrEntry
impl UnwindSafe for AttrEntry
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
Mutably borrows from an owned value. Read more