pub trait ESExprOptionalFieldCodec<'a>:
ESExprEncodedEq
+ Sized
+ 'a {
type Element: ESExprCodec<'a> + 'a;
// Required methods
fn encode_optional_field(&'a self) -> Option<ESExpr<'a>>;
fn decode_optional_field(
value: Option<ESExpr<'a>>,
) -> Result<Self, DecodeError>;
}Expand description
A field codec for optional fields.
Required Associated Types§
Sourcetype Element: ESExprCodec<'a> + 'a
type Element: ESExprCodec<'a> + 'a
The element type.
Required Methods§
Sourcefn encode_optional_field(&'a self) -> Option<ESExpr<'a>>
fn encode_optional_field(&'a self) -> Option<ESExpr<'a>>
Encode an optional field or None when the value should be excluded.
Sourcefn decode_optional_field(value: Option<ESExpr<'a>>) -> Result<Self, DecodeError>
fn decode_optional_field(value: Option<ESExpr<'a>>) -> Result<Self, DecodeError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.