pub trait Encode {
// Required method
fn encode(&self) -> Result<String, AcmeError>;
}Expand description
Trait which marks request/response bodies which can be encoded to string in some fashion.
This is only useful when formatting the response in the ACME-style HTTP
format, as used by crate::fmt::AcmeFormat.
There is a blanket implementation provided for any type which implements
serde::Serialize, as we assume that serializable values would be sent
over the wire as JSON (or at least, it is acceptable to display the value
as JSON when printing the ACME server response). Other types can
implement this to provide a custom representation when showing an ACME
response.