Skip to main content

always

Function always 

Source
pub fn always<T>(_: &T) -> bool
Expand description

Always returns true; a predicate for #[serde(skip_serializing_if)].

Use #[serde(skip_serializing_if = "::json_serde::always")] in place of #[serde(skip_serializing)] on fields that must never serialize when the containing type also derives the schemars 0.8 JsonSchema: schemars 0.8 (through 0.8.22) incorrectly marks default + skip_serializing fields as required in the generated schema, while conditionally-skipped fields are correctly optional. The two attribute forms serialize identically. See Absent.