pub struct FieldDecoder<'de> { /* private fields */ }Available on crate feature
schema-evolution only.Expand description
Stable-ID field access used by SchemaDecode implementations.
Implementations§
Source§impl<'de> FieldDecoder<'de>
impl<'de> FieldDecoder<'de>
Sourcepub fn required<T: NsonDeserialize<'de>>(&mut self, id: u32) -> Result<T>
pub fn required<T: NsonDeserialize<'de>>(&mut self, id: u32) -> Result<T>
Decodes a required field and reports a missing-field error.
Sourcepub fn optional<T: NsonDeserialize<'de>>(
&mut self,
id: u32,
) -> Result<Option<T>>
pub fn optional<T: NsonDeserialize<'de>>( &mut self, id: u32, ) -> Result<Option<T>>
Decodes an optional field, returning None when it is absent.
Sourcepub fn or_default<T: NsonDeserialize<'de> + Default>(
&mut self,
id: u32,
) -> Result<T>
pub fn or_default<T: NsonDeserialize<'de> + Default>( &mut self, id: u32, ) -> Result<T>
Decodes a field or returns its type’s default when absent.
Sourcepub fn unknown_fields(&self) -> impl Iterator<Item = UnknownField<'de>> + '_
pub fn unknown_fields(&self) -> impl Iterator<Item = UnknownField<'de>> + '_
Returns fields that have not been consumed by this schema revision.
Auto Trait Implementations§
impl<'de> Forget for FieldDecoder<'de>
impl<'de> Freeze for FieldDecoder<'de>
impl<'de> RefUnwindSafe for FieldDecoder<'de>
impl<'de> Send for FieldDecoder<'de>
impl<'de> Sync for FieldDecoder<'de>
impl<'de> Unpin for FieldDecoder<'de>
impl<'de> UnsafeUnpin for FieldDecoder<'de>
impl<'de> UnwindSafe for FieldDecoder<'de>
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