use super::macros::intermediate; use super::IObject; use crate::error::CustomError; use organic::types::StandardProperties; #[derive(Debug, Clone)] pub(crate) struct IParagraph { pub(crate) children: Vec, pub(crate) post_blank: organic::types::PostBlank, } intermediate!( IParagraph, &'orig organic::types::Paragraph<'parse>, original, intermediate_context, { let children = { let mut ret = Vec::new(); for obj in original.children.iter() { ret.push(IObject::new(intermediate_context.clone(), obj).await?); } ret }; Ok(IParagraph { children, post_blank: original.get_post_blank(), }) } ); impl IParagraph { pub(crate) async fn artificial<'orig, 'parse>( _intermediate_context: crate::intermediate::IntermediateContext<'orig, 'parse>, children: Vec, post_blank: organic::types::PostBlank, ) -> Result { Ok(IParagraph { children, post_blank, }) } }