natter/src/intermediate/quote_block.rs

27 lines
646 B
Rust
Raw Normal View History

2023-10-27 17:08:58 -04:00
use crate::error::CustomError;
use super::registry::Registry;
2023-10-27 19:53:18 -04:00
use super::IElement;
2023-10-27 17:08:58 -04:00
#[derive(Debug)]
2023-10-27 19:53:18 -04:00
pub(crate) struct IQuoteBlock {
pub(crate) children: Vec<IElement>,
}
2023-10-27 17:08:58 -04:00
impl IQuoteBlock {
2023-10-29 14:14:10 -04:00
pub(crate) async fn new<'b, 'parse>(
registry: &'b mut Registry<'parse>,
original: &'b organic::types::QuoteBlock<'parse>,
2023-10-27 17:08:58 -04:00
) -> Result<IQuoteBlock, CustomError> {
2023-10-27 19:53:18 -04:00
let children = {
let mut ret = Vec::new();
for obj in original.children.iter() {
ret.push(IElement::new(registry, obj).await?);
}
ret
};
Ok(IQuoteBlock { children })
2023-10-27 17:08:58 -04:00
}
}