pub struct Extensions<'a>(/* private fields */);Expand description
An opaque ordered collection of extension fields, represented as Postcard bytes.
Implementations§
Source§impl<'a> Extensions<'a>
impl<'a> Extensions<'a>
Sourcepub fn visit(
self,
context: &ReadContext<'_>,
visit: impl FnMut(u32, Field<'_, 'a>) -> Result<(), Error>,
) -> Result<(), Error>
pub fn visit( self, context: &ReadContext<'_>, visit: impl FnMut(u32, Field<'_, 'a>) -> Result<(), Error>, ) -> Result<(), Error>
Visit all IDs and length-bounded fields in strictly increasing order.
A callback can ignore the field or consume it with Field::decode. Successful visits check even the headers of fields the caller ignores.
§Errors
Returns malformed for zero, duplicate or descending IDs and invalid extents. Callback errors and allowance refusals propagate.
Trait Implementations§
Source§impl<'a> Clone for Extensions<'a>
impl<'a> Clone for Extensions<'a>
impl<'a> Copy for Extensions<'a>
Source§impl<'a> Debug for Extensions<'a>
impl<'a> Debug for Extensions<'a>
Source§impl<'de: 'a, 'a> Deserialize<'de> for Extensions<'a>
impl<'de: 'a, 'a> Deserialize<'de> for Extensions<'a>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl<'a> Eq for Extensions<'a>
Source§impl<'a> PartialEq for Extensions<'a>
impl<'a> PartialEq for Extensions<'a>
Source§impl Serialize for Extensions<'_>
impl Serialize for Extensions<'_>
impl<'a> StructuralPartialEq for Extensions<'a>
Auto Trait Implementations§
impl<'a> Forget for Extensions<'a>
impl<'a> Freeze for Extensions<'a>
impl<'a> Move for Extensions<'a>
impl<'a> RefUnwindSafe for Extensions<'a>
impl<'a> Send for Extensions<'a>
impl<'a> Sync for Extensions<'a>
impl<'a> Unpin for Extensions<'a>
impl<'a> UnsafeUnpin for Extensions<'a>where
&'a [u8]: UnsafeUnpin,
impl<'a> UnwindSafe for Extensions<'a>where
&'a [u8]: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more