natter/src/intermediate/paragraph.rs

22 lines
497 B
Rust
Raw Normal View History

use super::macros::intermediate;
2023-10-27 15:46:16 -04:00
use super::registry::Registry;
use super::IObject;
use crate::error::CustomError;
2023-10-27 15:46:16 -04:00
2023-10-29 15:36:15 -04:00
#[derive(Debug, Clone)]
2023-10-27 15:46:16 -04:00
pub(crate) struct IParagraph {
pub(crate) children: Vec<IObject>,
}
intermediate!(IParagraph, Paragraph, original, registry, {
let children = {
let mut ret = Vec::new();
for obj in original.children.iter() {
ret.push(IObject::new(registry, obj).await?);
}
ret
};
2023-10-27 15:46:16 -04:00
Ok(IParagraph { children })
});