2023-10-29 17:29:16 -04:00
|
|
|
use super::macros::intermediate;
|
2023-10-27 15:46:16 -04:00
|
|
|
use super::registry::Registry;
|
|
|
|
use super::IObject;
|
2023-10-29 17:29:16 -04:00
|
|
|
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>,
|
|
|
|
}
|
|
|
|
|
2023-10-29 18:35:42 -04:00
|
|
|
intermediate!(IParagraph, Paragraph, original, registry, {
|
2023-10-29 17:29:16 -04:00
|
|
|
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
|
|
|
|
2023-10-29 17:29:16 -04:00
|
|
|
Ok(IParagraph { children })
|
|
|
|
});
|