pub struct Section { /* private fields */ }Expand description
One section of the dump expressed as a name plus an ordered
list of (key, value) pairs. Sections always render the same
way, so authors can append a new field without touching the
formatter.
§Examples
use dynomite::admin::cluster_info::Section;
let s = Section::with_pairs("build", &[("version", "0.0.1")]);
assert_eq!(s.name(), "build");
assert_eq!(s.pairs().len(), 1);Implementations§
Source§impl Section
impl Section
Sourcepub fn with_pairs(name: &str, pairs: &[(&str, &str)]) -> Self
pub fn with_pairs(name: &str, pairs: &[(&str, &str)]) -> Self
Build a section with the supplied name and list of
(key, value) pairs. Both keys and values are copied
into owned strings so the section may outlive its inputs.
§Examples
use dynomite::admin::cluster_info::Section;
let s = Section::with_pairs("hello", &[("k", "v")]);
assert_eq!(s.pairs()[0].1, "v");Trait Implementations§
impl Eq for Section
impl StructuralPartialEq for Section
Auto Trait Implementations§
impl Freeze for Section
impl RefUnwindSafe for Section
impl Send for Section
impl Sync for Section
impl Unpin for Section
impl UnsafeUnpin for Section
impl UnwindSafe for Section
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§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.