pub struct Document<S> { /* private fields */ }
Implementations§
Source§impl<S: AsRef<str>> Document<S>
impl<S: AsRef<str>> Document<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<isize>
pub fn position(&self) -> Option<isize>
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 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§
Auto Trait Implementations§
impl<S> Freeze for Document<S>where
S: Freeze,
impl<S> RefUnwindSafe for Document<S>where
S: RefUnwindSafe,
impl<S> Send for Document<S>where
S: Send,
impl<S> Sync for Document<S>where
S: Sync,
impl<S> Unpin for Document<S>where
S: Unpin,
impl<S> UnwindSafe for Document<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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.