natter/src/intermediate/quote_block.rs
2023-10-29 12:24:49 -04:00

27 lines
680 B
Rust

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