pub struct SectionBlock<T> {
pub header_comments: Vec<String>,
pub data: T,
pub item_comments: IndexMap<String, String>,
pub item_order: Vec<String>,
pub raw_entries: Vec<RawEntry>,
}Expand description
A section block containing typed data plus formatting metadata.
Wraps a typed value (either Repo or MainConfig) together with
comments, entry ordering, and raw entry records to support round-trip
rendering.
§Examples
use dnf_repofile::{SectionBlock, Repo, RepoId};
let block = SectionBlock {
header_comments: vec![],
data: Repo::new(RepoId::try_new("test").unwrap()),
item_comments: indexmap::IndexMap::new(),
item_order: vec![],
raw_entries: vec![],
};Fields§
§header_comments: Vec<String>Comment lines and blank lines preceding the section header.
data: TThe typed section data (Repo or MainConfig).
item_comments: IndexMap<String, String>Inline comments for specific keys: key -> comment text.
item_order: Vec<String>Ordered list of key names as they appeared in the original file.
raw_entries: Vec<RawEntry>Raw key-value entries preserving comments and ordering.
Trait Implementations§
Source§impl<T: Clone> Clone for SectionBlock<T>
impl<T: Clone> Clone for SectionBlock<T>
Source§fn clone(&self) -> SectionBlock<T>
fn clone(&self) -> SectionBlock<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for SectionBlock<T>
impl<T: Debug> Debug for SectionBlock<T>
Source§impl<T: PartialEq> PartialEq for SectionBlock<T>
impl<T: PartialEq> PartialEq for SectionBlock<T>
Source§fn eq(&self, other: &SectionBlock<T>) -> bool
fn eq(&self, other: &SectionBlock<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T: Eq> Eq for SectionBlock<T>
impl<T> StructuralPartialEq for SectionBlock<T>
Auto Trait Implementations§
impl<T> Freeze for SectionBlock<T>where
T: Freeze,
impl<T> RefUnwindSafe for SectionBlock<T>where
T: RefUnwindSafe,
impl<T> Send for SectionBlock<T>where
T: Send,
impl<T> Sync for SectionBlock<T>where
T: Sync,
impl<T> Unpin for SectionBlock<T>where
T: Unpin,
impl<T> UnsafeUnpin for SectionBlock<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SectionBlock<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.