Trait hcl_edit::Decorate

source ·
pub trait Decorate {
    // Required methods
    fn decor(&self) -> &Decor;
    fn decor_mut(&mut self) -> &mut Decor;

    // Provided methods
    fn decorate(&mut self, decor: impl Into<Decor>) { ... }
    fn decorated(self, decor: impl Into<Decor>) -> Self
       where Self: Sized { ... }
}
Expand description

A trait for objects which can be decorated with whitespace and comments.

Required Methods§

source

fn decor(&self) -> &Decor

Returns a reference to the object’s Decor.

source

fn decor_mut(&mut self) -> &mut Decor

Returns a mutable reference to the object’s Decor.

Provided Methods§

source

fn decorate(&mut self, decor: impl Into<Decor>)

Decorate the object with decor in-place.

source

fn decorated(self, decor: impl Into<Decor>) -> Self
where Self: Sized,

Decorate the object with decor and return the modified value.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> Decorate for Box<T>
where T: Decorate,

source§

fn decor(&self) -> &Decor

source§

fn decor_mut(&mut self) -> &mut Decor

Implementors§