impl<'de> sfv::visitor::ItemVisitor<'de> for PriorityParameter<'_> { type Error = std::convert::Infallible;
fn bare_item( self,
bare_item: sfv::BareItemFromInput<'de>,
) -> Result<impl sfv::visitor::ParameterVisitor<'de>, Self::Error> { // Per https://httpwg.org/specs/rfc9218.html#parameters values of // unexpected types and out-of-range values are ignored. Since the same // dictionary key can appear multiple times in the input, and only the // last value may be considered per Structured Field semantics, we // overwrite any existing value with the default on error. matchself { Self::U(urgency) => *urgency = parse_urgency(bare_item.as_integer()), Self::I(incremental) => *incremental = parse_incremental(bare_item.as_boolean()),
} // Neither https://httpwg.org/specs/rfc9218.html#urgency nor // https://httpwg.org/specs/rfc9218.html#incremental defines parameters.
Ok(sfv::visitor::Ignored)
}
}
impl<'de> sfv::visitor::EntryVisitor<'de> for PriorityParameter<'_> { fn inner_list(self) -> Result<impl sfv::visitor::InnerListVisitor<'de>, Self::Error> { // Per https://httpwg.org/specs/rfc9218.html#parameters values of // unexpected types are ignored. Since the same dictionary key can // appear multiple times in the input, and only the last value may be // considered per Structured Field semantics, we overwrite any existing // value with the default. matchself { Self::U(urgency) => *urgency = DEFAULT_URGENCY, Self::I(incremental) => *incremental = DEFAULT_INCREMENTAL,
} // Per https://httpwg.org/specs/rfc9218.html#parameters values of // unexpected types are ignored.
Ok(sfv::visitor::Ignored)
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.