Trait esexpr::ESExprOptionalFieldCodec

source ·
pub trait ESExprOptionalFieldCodec
where Self: Sized,
{ // Required methods fn encode_optional_field(self) -> Option<ESExpr>; fn decode_optional_field(value: Option<ESExpr>) -> Result<Self, DecodeError>; }
Expand description

A field codec for optional fields.

Required Methods§

source

fn encode_optional_field(self) -> Option<ESExpr>

Encode an optional field or None when the value should be excluded.

source

fn decode_optional_field(value: Option<ESExpr>) -> Result<Self, DecodeError>

Decode an optional field value.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<A: ESExprCodec> ESExprOptionalFieldCodec for Option<A>

Implementors§