Add element.

This commit is contained in:
Tom Alexander
2023-10-27 15:32:24 -04:00
parent 7b01230234
commit 5b34942b64
4 changed files with 81 additions and 7 deletions

View File

@@ -1,15 +1,24 @@
use crate::error::CustomError;
use super::registry::Registry;
use super::IElement;
#[derive(Debug)]
pub(crate) struct ISection {}
pub(crate) struct ISection {
pub(crate) children: Vec<IElement>,
}
impl ISection {
pub(crate) fn new(
registry: &mut Registry<'_>,
section: &organic::types::Section<'_>,
pub(crate) fn new<'parse>(
registry: &mut Registry<'parse>,
section: &organic::types::Section<'parse>,
) -> Result<ISection, CustomError> {
Ok(ISection {})
let children = section
.children
.iter()
.map(|obj| IElement::new(registry, obj))
.collect::<Result<Vec<_>, _>>()?;
Ok(ISection { children })
}
}