Struct hcl::ser::Serializer

source ·
pub struct Serializer<'a, W> { /* private fields */ }
Expand description

A structure for serializing Rust values into HCL.

Implementations§

Creates a new Serializer which serializes to the provides writer using the default formatter.

Creates a new Serializer which uses the provides formatter to format the serialized HCL.

Consumes self and returns the wrapped writer.

Serialize the given value as HCL via the serializer’s Formatter to the underlying writer.

Errors

Serialization fails if the type cannot be represented as HCL.

Serialize the given value as HCL and returns the result as a String.

Errors

Serialization fails if the type cannot be represented as HCL.

Serialize the given value as HCL and returns the result as a Vec<u8>.

Errors

Serialization fails if the type cannot be represented as HCL.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.