natter/src/intermediate/section.rs

22 lines
494 B
Rust
Raw Normal View History

use super::macros::intermediate;
use super::registry::Registry;
2023-10-27 19:32:24 +00:00
use super::IElement;
use crate::error::CustomError;
2023-10-29 19:36:15 +00:00
#[derive(Debug, Clone)]
2023-10-27 19:32:24 +00:00
pub(crate) struct ISection {
pub(crate) children: Vec<IElement>,
}
intermediate!(ISection, Section, original, registry, {
let children = {
let mut ret = Vec::new();
for elem in original.children.iter() {
ret.push(IElement::new(registry, elem).await?);
}
ret
};
2023-10-27 19:32:24 +00:00
Ok(ISection { children })
});