pub enum PayloadPermission {
Permitted,
Forbidden,
}Expand description
Whether an Object carrying a given status is permitted a non-empty payload: the “Payload” column of the Object Status registry, MoQ Transport draft-19 Section 15.9, Table 16.
Draft-19 Section 11.2.1.1 phrases the rule as “An Object MUST have an empty
payload unless its Object Status value is registered as permitting a
payload”, and Section 15.9 adds that each new registration “MUST indicate
whether the status permits a payload”. Modelling the column as a value keeps
that obligation visible: a status cannot be added to ObjectStatus
without ObjectStatus::payload_permission refusing to compile until its
column is filled in.
Earlier drafts had no such column — draft-18 and its predecessors derived the same answer arithmetically, from the status being non-zero — so this type is deliberately draft-19-only rather than shared.
Variants§
Permitted
Registry column “Yes”. The status permits a payload but does not require one: a zero-length Object with such a status is well formed.
Forbidden
Registry column “No”. 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.
The permission answers on its own, without a payload length in hand, which is the point of moving the rule onto 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