use crate::error::CustomError; use super::registry::Registry; use super::IObject; #[derive(Debug)] pub(crate) struct IRegularLink { pub(crate) raw_link: String, pub(crate) children: Vec, } impl IRegularLink { pub(crate) async fn new<'b, 'parse>( registry: &'b mut Registry<'parse>, original: &'b organic::types::RegularLink<'parse>, ) -> Result { let children = { let mut ret = Vec::new(); for obj in original.children.iter() { ret.push(IObject::new(registry, obj).await?); } ret }; Ok(IRegularLink { raw_link: original.get_raw_link().into_owned(), children, }) } }