Skip to main content

Crate flyleaf_core

Crate flyleaf_core 

Source
Expand description

The document behind Tommy Flyleaf: a TOML file edited as a tree, with its comments, key order and formatting kept for everything that was not edited.

No user interface. Everything here is an operation on a toml_edit document that the widget in flyleaf asks for and never performs itself, so that there is one place a change goes through.

Re-exports§

pub use toml_edit;

Structs§

Document
A TOML document together with what its file looked like.

Enums§

Error
Why a file did not become a document, or a document a file.
Kind
A kind of value, or a table.
Newline
The line ending a file was written with.

Functions§

add_inline_key
Add a key to an inline table.
add_key
Add a key to a table.
comment_beside
The comment in a decor’s suffix, which is the one beside a value.
comments_before
The comment lines in a decor’s prefix, without their # and the whitespace around each.
convert
The value as another kind, where it reads as one; None where the change would be a guess.
convert_element
Change the element at an index to another kind, where it reads as one.
convert_inline_key
Change a key’s value in an inline table to another kind, where it reads as one. A table cannot be inside an inline table, so that is refused.
convert_key
Change a key’s value to another kind, where it reads as one, keeping its place and its decor.
push_element
Add an element of a kind at the end, in the style of the element before it.
remove_element
Remove the element at an index.
remove_inline_key
Remove a key from an inline table.
remove_key
Remove a key, and everything under it where it is a table.
rename_inline_key
Rename a key in an inline table, keeping its place and its decor.
rename_key
Rename a key, keeping its place in the document and the decor it carried.
set_comment_beside
Replace the comment in a decor’s suffix, keeping the space before it, or remove it.
set_comments_before
Replace the comment lines in a decor’s prefix, keeping the blank lines before them and the indentation after them. No lines removes the comment and leaves the whitespace.
set_element
Change the element at an index, keeping the decor it was written with.
set_trailing_comments
Replace the comment lines after the last item, keeping the blank lines before them.
set_value
Change a value, keeping the decor it was written with.
trailing_comments
The comment lines after the last item of a document.