Type Alias Document

Source
pub type Document = DocumentMut;
👎Deprecated since 0.22.6: Replaced with DocumentMut
Expand description

Deprecated, replaced with DocumentMut

Aliased Type§

struct Document { /* private fields */ }

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 200 bytes

Implementations

Source§

impl DocumentMut

Source

pub fn new() -> Self

Creates an empty document

Source

pub fn as_item(&self) -> &Item

Returns a reference to the root item.

Source

pub fn as_item_mut(&mut self) -> &mut Item

Returns a mutable reference to the root item.

Source

pub fn as_table(&self) -> &Table

Returns a reference to the root table.

Source

pub fn as_table_mut(&mut self) -> &mut Table

Returns a mutable reference to the root table.

Source

pub fn iter(&self) -> Iter<'_>

Returns an iterator over the root table.

Source

pub fn set_trailing(&mut self, trailing: impl Into<RawString>)

Set whitespace after last element

Source

pub fn trailing(&self) -> &RawString

Whitespace after last element

Trait Implementations

Source§

impl Clone for DocumentMut

Source§

fn clone(&self) -> DocumentMut

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DocumentMut

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DocumentMut

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Deref for DocumentMut

Source§

type Target = Table

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for DocumentMut

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Display for DocumentMut

Available on crate feature display only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Table> for DocumentMut

Source§

fn from(root: Table) -> Self

Converts to this type from the input type.
Source§

impl FromStr for DocumentMut

Available on crate feature parse only.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a document from a &str

Source§

type Err = TomlError

The associated error which can be returned from parsing.
Source§

impl<'s> Index<&'s str> for DocumentMut

Source§

type Output = Item

The returned type after indexing.
Source§

fn index(&self, key: &'s str) -> &Item

Performs the indexing (container[index]) operation. Read more
Source§

impl<'s> IndexMut<&'s str> for DocumentMut

Source§

fn index_mut(&mut self, key: &'s str) -> &mut Item

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IntoDeserializer<'_, Error> for DocumentMut

Available on crate feature serde only.
Source§

type Deserializer = Deserializer

The type of the deserializer being converted into.
Source§

fn into_deserializer(self) -> Self::Deserializer

Convert this value into a deserializer.