use super::macros::intermediate; use super::registry::Registry; use super::IPlainListItem; use crate::error::CustomError; #[derive(Debug, Clone)] pub(crate) struct IPlainList { pub(crate) list_type: organic::types::PlainListType, pub(crate) children: Vec, } intermediate!(IPlainList, PlainList, |registry, original| async { let children = { let mut ret = Vec::new(); for obj in original.children.iter() { ret.push(IPlainListItem::new(registry, obj).await?); } ret }; Ok(IPlainList { list_type: original.list_type, children, }) });