2023-10-27 21:08:58 +00:00
|
|
|
use crate::error::CustomError;
|
|
|
|
|
2023-10-29 17:51:32 +00:00
|
|
|
use super::ast_node::IAstNode;
|
2023-10-27 21:08:58 +00:00
|
|
|
use super::registry::Registry;
|
2023-10-29 17:51:32 +00:00
|
|
|
use super::IElement;
|
|
|
|
use super::IObject;
|
2023-10-27 21:08:58 +00:00
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub(crate) struct IFootnoteDefinition {}
|
|
|
|
|
|
|
|
impl IFootnoteDefinition {
|
2023-10-29 18:14:10 +00:00
|
|
|
pub(crate) async fn new<'b, 'parse>(
|
|
|
|
registry: &'b mut Registry<'parse>,
|
|
|
|
original: &'b organic::types::FootnoteDefinition<'parse>,
|
2023-10-27 21:08:58 +00:00
|
|
|
) -> Result<IFootnoteDefinition, CustomError> {
|
2023-10-29 18:14:10 +00:00
|
|
|
registry
|
|
|
|
.register_footnote_definition(original.label, &original.children)
|
|
|
|
.await?;
|
2023-10-27 21:08:58 +00:00
|
|
|
Ok(IFootnoteDefinition {})
|
|
|
|
}
|
|
|
|
}
|
2023-10-29 17:51:32 +00:00
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub(crate) struct IRealFootnoteDefinition {
|
|
|
|
footnote_id: usize,
|
|
|
|
contents: Vec<IAstNode>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl IRealFootnoteDefinition {
|
2023-10-29 18:14:10 +00:00
|
|
|
pub(crate) async fn new<'b, 'parse>(
|
|
|
|
registry: &'b mut Registry<'parse>,
|
2023-10-29 17:51:32 +00:00
|
|
|
footnote_id: usize,
|
2023-10-29 18:14:10 +00:00
|
|
|
contents: Vec<IAstNode>,
|
2023-10-29 17:51:32 +00:00
|
|
|
) -> Result<IRealFootnoteDefinition, CustomError> {
|
|
|
|
Ok(IRealFootnoteDefinition {
|
|
|
|
footnote_id,
|
|
|
|
contents,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|