Trait hcl::format::Format

source ·
pub trait Format: Sealed {
    fn format<W>(&self, fmt: &mut Formatter<'_, W>) -> Result<()>
    where
        W: Write
; fn format_vec<W>(&self, fmt: &mut Formatter<'_, W>) -> Result<Vec<u8>>
    where
        W: Write + AsMut<Vec<u8>>
, { ... } fn format_string<W>(&self, fmt: &mut Formatter<'_, W>) -> Result<String>
    where
        W: Write + AsMut<Vec<u8>>
, { ... } }
Expand description

A trait to format data structures as HCL.

This trait is sealed to prevent implementation outside of this crate.

Required Methods§

Formats a HCL structure using a formatter and writes the result to the provided writer.

Errors

Formatting the data structure or writing to the writer may fail with an Error.

Provided Methods§

Formats a HCL structure using a formatter and returns the result as a Vec<u8>.

Errors

Formatting the data structure or writing to the writer may fail with an Error.

Formats a HCL structure using a formatter and returns the result as a String.

Errors

Formatting the data structure or writing to the writer may fail with an Error.

Implementations on Foreign Types§

Implementors§