Struct toml_edit::ImDocument
source · pub struct ImDocument<S> { /* private fields */ }
Expand description
Type representing a parsed TOML document
Implementations§
source§impl<S: AsRef<str>> ImDocument<S>
impl<S: AsRef<str>> ImDocument<S>
source§impl<S> ImDocument<S>
impl<S> ImDocument<S>
source§impl<S: AsRef<str>> ImDocument<S>
impl<S: AsRef<str>> ImDocument<S>
source§impl<S: AsRef<str>> ImDocument<S>
impl<S: AsRef<str>> ImDocument<S>
sourcepub fn into_mut(self) -> DocumentMut
pub fn into_mut(self) -> DocumentMut
Allow editing of the DocumentMut
Methods from Deref<Target = Table>§
sourcepub fn get_values(&self) -> Vec<(Vec<&Key>, &Value)>
pub fn get_values(&self) -> Vec<(Vec<&Key>, &Value)>
Get key/values for values that are visually children of this table
For example, this will return dotted keys
sourcepub fn is_implicit(&self) -> bool
pub fn is_implicit(&self) -> bool
If a table has no key/value pairs and implicit, it will not be displayed.
sourcepub fn is_dotted(&self) -> bool
pub fn is_dotted(&self) -> bool
Check if this is a wrapper for dotted keys, rather than a standard table
sourcepub fn position(&self) -> Option<usize>
pub fn position(&self) -> Option<usize>
The position of the Table
within the DocumentMut
.
Returns None
if the Table
was created manually (i.e. not via parsing)
in which case its position is set automatically. This can be overridden with
Table::set_position
.
sourcepub fn key_decor(&self, key: &str) -> Option<&Decor>
👎Deprecated since 0.21.1: Replaced with key_mut
pub fn key_decor(&self, key: &str) -> Option<&Decor>
key_mut
Returns the decor associated with a given key of the table.
sourcepub fn span(&self) -> Option<Range<usize>>
pub fn span(&self) -> Option<Range<usize>>
The location within the original document
This generally requires an ImDocument
.
sourcepub fn get<'a>(&'a self, key: &str) -> Option<&'a Item>
pub fn get<'a>(&'a self, key: &str) -> Option<&'a Item>
Returns an optional reference to an item given the key.
sourcepub fn get_key_value<'a>(&'a self, key: &str) -> Option<(&'a Key, &'a Item)>
pub fn get_key_value<'a>(&'a self, key: &str) -> Option<(&'a Key, &'a Item)>
Return references to the key-value pair stored for key, if it is present, else None.
sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Returns true if the table contains an item with the given key.
sourcepub fn contains_table(&self, key: &str) -> bool
pub fn contains_table(&self, key: &str) -> bool
Returns true if the table contains a table with the given key.
sourcepub fn contains_value(&self, key: &str) -> bool
pub fn contains_value(&self, key: &str) -> bool
Returns true if the table contains a value with the given key.
sourcepub fn contains_array_of_tables(&self, key: &str) -> bool
pub fn contains_array_of_tables(&self, key: &str) -> bool
Returns true if the table contains an array of tables with the given key.
Trait Implementations§
source§impl<S: Clone> Clone for ImDocument<S>
impl<S: Clone> Clone for ImDocument<S>
source§fn clone(&self) -> ImDocument<S>
fn clone(&self) -> ImDocument<S>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<S: Debug> Debug for ImDocument<S>
impl<S: Debug> Debug for ImDocument<S>
source§impl Default for ImDocument<&'static str>
impl Default for ImDocument<&'static str>
source§impl<S> Deref for ImDocument<S>
impl<S> Deref for ImDocument<S>
source§impl<S> From<ImDocument<S>> for Deserializer<S>
Available on crate feature serde
only.
impl<S> From<ImDocument<S>> for Deserializer<S>
serde
only.source§fn from(doc: ImDocument<S>) -> Self
fn from(doc: ImDocument<S>) -> Self
source§impl FromStr for ImDocument<String>
Available on crate feature parse
only.
impl FromStr for ImDocument<String>
parse
only.source§impl<'de> IntoDeserializer<'de, Error> for ImDocument<String>
Available on crate feature serde
only.
impl<'de> IntoDeserializer<'de, Error> for ImDocument<String>
serde
only.source§type Deserializer = Deserializer
type Deserializer = Deserializer
source§fn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Auto Trait Implementations§
impl<S> Freeze for ImDocument<S>where
S: Freeze,
impl<S> RefUnwindSafe for ImDocument<S>where
S: RefUnwindSafe,
impl<S> Send for ImDocument<S>where
S: Send,
impl<S> Sync for ImDocument<S>where
S: Sync,
impl<S> Unpin for ImDocument<S>where
S: Unpin,
impl<S> UnwindSafe for ImDocument<S>where
S: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)