use crate::error::CustomError; use super::registry::Registry; use super::IPlainListItem; #[derive(Debug)] pub(crate) struct IPlainList { pub(crate) list_type: organic::types::PlainListType, pub(crate) children: Vec, } impl IPlainList { pub(crate) async fn new<'parse>( registry: &mut Registry<'parse>, plain_list: &organic::types::PlainList<'parse>, ) -> Result { let children = { let mut ret = Vec::new(); for obj in plain_list.children.iter() { ret.push(IPlainListItem::new(registry, obj).await?); } ret }; Ok(IPlainList { list_type: plain_list.list_type, children, }) } }