pub trait HeaderExt: Header { // Provided method fn header(&self, id: impl AsRef<oid>) -> Result<Header, Error> { ... } }
An extension trait with convenience functions.
Like try_header(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error.
try_header(…)
Result<Option<_>>
Result