natter/src/intermediate/paragraph.rs

28 lines
564 B
Rust
Raw Normal View History

use super::macros::intermediate;
2023-10-29 22:31:29 -04:00
2023-10-27 15:46:16 -04:00
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,
&'orig organic::types::Paragraph<'parse>,
original,
registry,
{
let children = {
let mut ret = Vec::new();
for obj in original.children.iter() {
ret.push(IObject::new(registry.clone(), obj).await?);
}
ret
};
2023-10-27 15:46:16 -04:00
Ok(IParagraph { children })
}
);