[][src]Struct bml::BmlNode

pub struct BmlNode { /* fields omitted */ }

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]

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]

#[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_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]

type Error = BmlError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl Send for BmlNode

impl Sync for BmlNode

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]