use crate::error::CustomError; use super::registry::Registry; use super::IObject; #[derive(Debug)] pub(crate) struct IParagraph { pub(crate) children: Vec, } impl IParagraph { pub(crate) fn new<'parse>( registry: &mut Registry<'parse>, paragraph: &organic::types::Paragraph<'parse>, ) -> Result { let children = paragraph .children .iter() .map(|obj| IObject::new(registry, obj)) .collect::, _>>()?; Ok(IParagraph { children }) } }