pub struct Field<'cursor, 'de> { /* private fields */ }Expand description
One object member. The value must be consumed with one of this type’s methods before requesting the next field.
Implementations§
Source§impl<'de> Field<'_, 'de>
impl<'de> Field<'_, 'de>
Sourcepub fn skip(self) -> Result<()>
pub fn skip(self) -> Result<()>
Skips and validates this member’s value without constructing it.
§Errors
Returns an error for malformed JSON.
Sourcepub fn string(self) -> Result<Cow<'de, str>>
pub fn string(self) -> Result<Cow<'de, str>>
Decodes this member as a string, borrowing when it has no escapes.
§Errors
Returns an error when the value is not a valid JSON string.
Sourcepub fn deserialize<T: Deserialize<'de>>(self) -> Result<T>
pub fn deserialize<T: Deserialize<'de>>(self) -> Result<T>
Deserializes this member into a Serde type.
§Errors
Returns an error for malformed JSON or a type mismatch.
Auto Trait Implementations§
impl<'cursor, 'de> !UnwindSafe for Field<'cursor, 'de>
impl<'cursor, 'de> Freeze for Field<'cursor, 'de>
impl<'cursor, 'de> RefUnwindSafe for Field<'cursor, 'de>
impl<'cursor, 'de> Send for Field<'cursor, 'de>
impl<'cursor, 'de> Sync for Field<'cursor, 'de>
impl<'cursor, 'de> Unpin for Field<'cursor, 'de>
impl<'cursor, 'de> UnsafeUnpin for Field<'cursor, '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