pub enum PayloadPermission {
Permitted,
Forbidden,
}Expand description
Whether an object carrying a given status is allowed a non-empty payload.
Draft-17 Section 10.2.1.1 states the rule arithmetically rather than as a table: “Any object with a status code other than zero MUST have an empty payload.” So the answer is a property of the status code, and every code but Normal forbids a payload.
Forbidding is the strict half; permitting is not requiring. A Normal object with no payload is well formed, and this draft’s encodings have a way to spell it — a zero Object Payload Length followed by the status code 0x0.
Variants§
Permitted
The status permits a payload but does not require one.
Forbidden
An object with this 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.
The permission answers on its own, without a payload length in hand, which is the point of reading it off the status.
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