tree_xml/traits.rs
1/// Helper trait to transform an struct into an Iterator of Key-Value pairs for the attributes of a [`Node`].
2pub trait IntoAttributes {
3 /// Gets an iterator of an ([`String`], [`String`]) tuple.
4 fn to_attributes(&self) -> impl IntoIterator<Item = (String, String)>;
5}
6
7/// Helper trait to transform an struct into an Iterator of nodes for the childs of a [`Node`].
8pub trait IntoChilds {
9 /// Gets an iterator of [Nodes](crate::node::Node).
10 fn to_childs(&self) -> impl IntoIterator<Item = crate::node::Node>;
11}