Add plain list items.
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user