pub trait GoStruct: GoJson {
// Required methods
fn encode_fields(&self, w: &mut ObjWriter<'_>);
fn decode_field(
&mut self,
key: &str,
v: &Node,
) -> Option<Result<(), DecodeError>>;
}Expand description
A Go struct: encodes its fields in order and decodes them by name.
Required Methods§
fn encode_fields(&self, w: &mut ObjWriter<'_>)
Sourcefn decode_field(
&mut self,
key: &str,
v: &Node,
) -> Option<Result<(), DecodeError>>
fn decode_field( &mut self, key: &str, v: &Node, ) -> Option<Result<(), DecodeError>>
Decodes v into the field named key (exact match first, then
case-insensitive). None when no field matches.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".