pub struct Section<'y> {
yamler: &'y mut Yamler,
}Expand description
Tracks the start and end of an indented block (a “section”)
Fields§
§yamler: &'y mut YamlerImplementations§
Methods from Deref<Target = Yamler>§
pub fn indent(&mut self) -> Section<'_>
fn newline(&mut self) -> &mut Self
fn increase(&mut self)
fn decrease(&mut self)
fn print_indentation(&mut self, writer: &mut impl Write)
Sourcepub fn key(&mut self, name: impl Yamlify) -> Section<'_>
pub fn key(&mut self, name: impl Yamlify) -> Section<'_>
Prints a section header and increases indentation
Sourcepub fn pair<D: Yamlify, T: Yamlify>(&mut self, name: D, value: T) -> &mut Self
pub fn pair<D: Yamlify, T: Yamlify>(&mut self, name: D, value: T) -> &mut Self
Prints a yaml key value pair: - name: "value"
Sourcepub fn value<D: Yamlify>(&mut self, value: D) -> &mut Self
pub fn value<D: Yamlify>(&mut self, value: D) -> &mut Self
Prints a yaml scalar value: `“name”``
pub fn list<D: Yamlify>(&mut self, list: &[D]) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl<'y> Freeze for Section<'y>
impl<'y> RefUnwindSafe for Section<'y>
impl<'y> Send for Section<'y>
impl<'y> Sync for Section<'y>
impl<'y> Unpin for Section<'y>
impl<'y> UnsafeUnpin for Section<'y>
impl<'y> !UnwindSafe for Section<'y>
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