pub struct Root<'de> {
pub ctx: Context<'de>,
/* private fields */
}Expand description
Holds both the root table and the parsing context for deserialization.
During deserialization the document tree remains immutable. Use
Root::into_table() to extract the table for mutable access.
Fields§
§ctx: Context<'de>Implementations§
Source§impl<'de> Root<'de>
impl<'de> Root<'de>
Sourcepub fn into_table(self) -> Table<'de>
pub fn into_table(self) -> Table<'de>
Extracts the root table for mutable access. Root is consumed.
You can also access the root table immutably via Root::table().
Source§impl<'de> Root<'de>
impl<'de> Root<'de>
Sourcepub fn helper<'ctx>(&'ctx mut self) -> TableHelper<'ctx, 'ctx, 'de>
pub fn helper<'ctx>(&'ctx mut self) -> TableHelper<'ctx, 'ctx, 'de>
Create a TableHelper for the root table.
Sourcepub fn deserialize<T>(&mut self) -> Result<T, Failed>where
T: Deserialize<'de>,
pub fn deserialize<T>(&mut self) -> Result<T, Failed>where
T: Deserialize<'de>,
Deserialize the root table into a typed value.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Returns true if any deserialization errors have been recorded.
Trait Implementations§
Auto Trait Implementations§
impl<'de> Freeze for Root<'de>
impl<'de> !RefUnwindSafe for Root<'de>
impl<'de> !Send for Root<'de>
impl<'de> !Sync for Root<'de>
impl<'de> Unpin for Root<'de>
impl<'de> UnsafeUnpin for Root<'de>
impl<'de> !UnwindSafe for Root<'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