Type Alias Document

pub type Document = DocumentMut;
👎Deprecated since 0.22.6: Replaced with DocumentMut
Available on crate feature dep_toml_edit only.
Expand description

Deprecated, replaced with DocumentMut

Aliased Type§

struct Document { /* private fields */ }

Implementations

§

impl DocumentMut

pub fn new() -> DocumentMut

Creates an empty document

pub fn as_item(&self) -> &Item

Returns a reference to the root item.

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

Returns a mutable reference to the root item.

pub fn as_table(&self) -> &Table

Returns a reference to the root table.

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

Returns a mutable reference to the root table.

pub fn iter(&self) -> Box<dyn Iterator<Item = (&str, &Item)> + '_>

Returns an iterator over the root table.

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

Set whitespace after last element

pub fn trailing(&self) -> &RawString

Whitespace after last element

Trait Implementations

§

impl Clone for DocumentMut

§

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
§

impl Debug for DocumentMut

§

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

Formats the value using the given formatter. Read more
§

impl Default for DocumentMut

§

fn default() -> DocumentMut

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

impl Deref for DocumentMut

§

type Target = Table

The resulting type after dereferencing.
§

fn deref(&self) -> &<DocumentMut as Deref>::Target

Dereferences the value.
§

impl DerefMut for DocumentMut

§

fn deref_mut(&mut self) -> &mut <DocumentMut as Deref>::Target

Mutably dereferences the value.
§

impl Display for DocumentMut

§

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

Formats the value using the given formatter. Read more
§

impl From<Table> for DocumentMut

§

fn from(root: Table) -> DocumentMut

Converts to this type from the input type.
§

impl FromStr for DocumentMut

§

fn from_str(s: &str) -> Result<DocumentMut, <DocumentMut as FromStr>::Err>

Parses a document from a &str

§

type Err = TomlError

The associated error which can be returned from parsing.
§

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

§

type Output = Item

The returned type after indexing.
§

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

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

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

§

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

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

impl IntoDeserializer<'_, Error> for DocumentMut

§

type Deserializer = Deserializer

The type of the deserializer being converted into.
§

fn into_deserializer( self, ) -> <DocumentMut as IntoDeserializer<'_, Error>>::Deserializer

Convert this value into a deserializer.