pub struct Absent;Expand description
Type for a value that must be absent.
This should be accompanied by serde attributes to indicate that:
- the default value should be taken
#[serde(default)] - it should never be serialized
#[serde(skip_serializing)](or#[serde(skip_serializing_if = "::json_serde::always")]; seealways)
Deserialization always fails–the field must not be present–and
serialization fails if it is ever invoked, hence the attributes above.
With the schemars08 and schemars1 features, Absent’s JsonSchema
implementation is the false schema, which no value satisfies.
Trait Implementations§
impl Copy for Absent
Source§impl<'de> Deserialize<'de> for Absent
impl<'de> Deserialize<'de> for Absent
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Absent
Source§impl JsonSchema for Absent
Available on crate feature schemars08 only.
impl JsonSchema for Absent
Available on crate feature
schemars08 only.Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl JsonSchema for Absent
Available on crate feature schemars1 only.
impl JsonSchema for Absent
Available on crate feature
schemars1 only.Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for Absent
impl Ord for Absent
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Absent
impl PartialOrd for Absent
impl StructuralPartialEq for Absent
Auto Trait Implementations§
impl Freeze for Absent
impl RefUnwindSafe for Absent
impl Send for Absent
impl Sync for Absent
impl Unpin for Absent
impl UnsafeUnpin for Absent
impl UnwindSafe for Absent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more