pub enum PayloadPermission {
Permitted,
Forbidden,
}Expand description
Whether an Object carrying a given status is permitted a non-empty payload.
Draft-18 Section 11.2.1.1 states the rule in one sentence — “Any object with a status code other than zero MUST have an empty payload” — so unlike a draft that gives its Object Status registry a payload column, there is no per-status datum to carry around: the answer is derived from the code, and this type is the answer rather than the source of it.
It exists so a caller can ask the question without restating the rule. A caller that reaches for the status code and compares it to zero has copied the sentence into its own source, where it cannot follow the draft.
Variants§
Permitted
The status permits a payload but does not require one: a zero-length Object with such a status is well formed. Only Normal, on draft-18.
Forbidden
An Object with such a status has an empty payload, and one carrying bytes is malformed.
Implementations§
Source§impl PayloadPermission
impl PayloadPermission
Sourcepub fn permits(self) -> bool
pub fn permits(self) -> bool
true for PayloadPermission::Permitted.
Trait Implementations§
Source§impl Clone for PayloadPermission
impl Clone for PayloadPermission
Source§fn clone(&self) -> PayloadPermission
fn clone(&self) -> PayloadPermission
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more