Add plain list items.

This commit is contained in:
Tom Alexander
2023-10-27 20:18:19 -04:00
parent 62ffc76376
commit bfc9e3ed80
3 changed files with 59 additions and 7 deletions

View File

@@ -1,15 +1,36 @@
use crate::error::CustomError;
use super::registry::Registry;
use super::IElement;
use super::IObject;
#[derive(Debug)]
pub(crate) struct IPlainListItem {}
pub(crate) struct IPlainListItem {
pub(crate) tag: Vec<IObject>,
pub(crate) children: Vec<IElement>,
}
impl IPlainListItem {
pub(crate) async fn new<'parse>(
registry: &mut Registry<'parse>,
plain_list_item: &organic::types::PlainListItem<'parse>,
) -> Result<IPlainListItem, CustomError> {
Ok(IPlainListItem {})
let tag = {
let mut ret = Vec::new();
for obj in plain_list_item.tag.iter() {
ret.push(IObject::new(registry, obj).await?);
}
ret
};
let children = {
let mut ret = Vec::new();
for elem in plain_list_item.children.iter() {
ret.push(IElement::new(registry, elem).await?);
}
ret
};
Ok(IPlainListItem { tag, children })
}
}