Lyricdev
GitHub

interface Encode

pub interface Encode

A value that writes itself into any encoder.

Methods

fn encode<E :: [Encoder]>(&e: E): void throws EncodeError

Writes this value into e. Synthesized for a conformance without the member: a struct's fields in declaration order under their wire names, a @Codec { skip } field left out; an enum's variant — a unit one as its name, one payload field as the value, several as a sequence — or, under the enum's @Codec { tag }, as a struct of the tag and the payload's fields.

Errors

Throws EncodeError where the encoder cannot hold a form or its writer fails.