[−][src]Struct bml::BmlNode
BML node comprising data lines()
and child nodes()
.
By design, attributes are considered child nodes as well but carry a flag marking them as attributes for serialization purpose only.
Methods
impl BmlNode
[src]
pub fn value(&self) -> &str
[src]
Value comprising data lines with '\n'
removed from last line.
pub fn lines(&self) -> impl DoubleEndedIterator<Item = &str>
[src]
Iterator over data lines.
pub fn nodes(
&self
) -> impl DoubleEndedIterator<Item = (&str, &BmlNode)> + ExactSizeIterator
[src]
&self
) -> impl DoubleEndedIterator<Item = (&str, &BmlNode)> + ExactSizeIterator
Iterator over child nodes as (name, node)
tuples.
pub fn named(&self, name: &str) -> impl DoubleEndedIterator<Item = &BmlNode>
[src]
Iterator over child nodes of name
.
NOTE: Fallback implementation for stable Rust using Vec
instead
of ordered_multimap::ListOrderedMultimap
. On nightly Rust enable the
ordered-multimap
feature to reduce the complexity to O(m) where m
is the number of nodes matching name
.
Complexity: O(n) where n is the total number of child nodes.
pub fn set_indent(&mut self, string: &'static str, repeat: usize)
[src]
Indent string
of child nodes and level as repeat
times string
.
Default is two spaces as in " "
and no root indent (0
).
Usual alternative is a tabulator as in "\t"
and no root indent (0
).
Trait Implementations
impl PartialEq<BmlNode> for BmlNode
[src]
fn eq(&self, other: &BmlNode) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Default for BmlNode
[src]
impl Clone for BmlNode
[src]
fn clone(&self) -> BmlNode
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for BmlNode
[src]
impl Display for BmlNode
[src]
impl Debug for BmlNode
[src]
impl<'_> TryFrom<&'_ str> for BmlNode
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,