pub trait SerdeConfig {
// Provided methods
fn body_name(&self) -> Cow<'static, str> { ... }
fn err_msg_name(&self) -> Cow<'static, str> { ... }
fn fixed_field(&self) -> bool { ... }
fn signed_status(&self) -> Option<StatusSign> { ... }
fn extra_message(&self) -> Option<Cow<'static, str>> { ... }
}Expand description
the config information of serialize
Provided Methods§
Sourcefn body_name(&self) -> Cow<'static, str>
fn body_name(&self) -> Cow<'static, str>
the name of body field, the field will be available when the RespResult
is Success(_)
§Default
the default field name is body
Sourcefn err_msg_name(&self) -> Cow<'static, str>
fn err_msg_name(&self) -> Cow<'static, str>
the name of error_message field, this field will be available when RespResult
is Err(_)
§Default
the default field name is error-message
Sourcefn fixed_field(&self) -> bool
fn fixed_field(&self) -> bool
fixed field size,
- if return
true, will also serialize not available field withnull
§Default
the default value is true
Sourcefn signed_status(&self) -> Option<StatusSign>
fn signed_status(&self) -> Option<StatusSign>
sign the status of response
- Some(_) enable this sign
- None disable this sign
§Default
default enable this sign using bool
- true ->
Success - false ->
Err