pub enum PayloadPermission {
Permitted,
Forbidden,
}Expand description
Whether an Object carrying a given status is allowed a non-empty payload.
Draft-16 Section 10.2.1.1 states the rule in one sentence — “Any object with a status code other than zero MUST have an empty payload” — and the same section makes Normal (0x0) “implicit for any non-zero length object”. So the permission follows from the status code alone, with no payload length in hand, which is what makes it worth naming: a caller that has only an object’s framing can ask whether the bytes it is about to forward are allowed there at all.
Variants§
Permitted
The status permits a payload but does not require one: a zero-length object with such a status is well formed, and draft-16’s encodings can spell it.
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