Implement Into for AstNode.
This commit is contained in:
		
							parent
							
								
									9111408d83
								
							
						
					
					
						commit
						df5d699a39
					
				| @ -11,6 +11,7 @@ use crate::types::DiarySexp; | ||||
| use crate::types::Document; | ||||
| use crate::types::Drawer; | ||||
| use crate::types::DynamicBlock; | ||||
| use crate::types::Element; | ||||
| use crate::types::Entity; | ||||
| use crate::types::ExampleBlock; | ||||
| use crate::types::ExportBlock; | ||||
| @ -28,6 +29,7 @@ use crate::types::Keyword; | ||||
| use crate::types::LatexEnvironment; | ||||
| use crate::types::LatexFragment; | ||||
| use crate::types::LineBreak; | ||||
| use crate::types::Object; | ||||
| use crate::types::OrgMacro; | ||||
| use crate::types::Paragraph; | ||||
| use crate::types::PlainLink; | ||||
| @ -108,3 +110,327 @@ pub enum AstNode<'r, 's> { | ||||
|     Superscript(&'r Superscript<'s>), | ||||
|     Timestamp(&'r Timestamp<'s>), | ||||
| } | ||||
| 
 | ||||
| impl<'r, 's> From<&'r Element<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Element<'s>) -> Self { | ||||
|         match value { | ||||
|             Element::Paragraph(inner) => inner.into(), | ||||
|             Element::PlainList(inner) => inner.into(), | ||||
|             Element::GreaterBlock(inner) => inner.into(), | ||||
|             Element::DynamicBlock(inner) => inner.into(), | ||||
|             Element::FootnoteDefinition(inner) => inner.into(), | ||||
|             Element::Comment(inner) => inner.into(), | ||||
|             Element::Drawer(inner) => inner.into(), | ||||
|             Element::PropertyDrawer(inner) => inner.into(), | ||||
|             Element::Table(inner) => inner.into(), | ||||
|             Element::VerseBlock(inner) => inner.into(), | ||||
|             Element::CommentBlock(inner) => inner.into(), | ||||
|             Element::ExampleBlock(inner) => inner.into(), | ||||
|             Element::ExportBlock(inner) => inner.into(), | ||||
|             Element::SrcBlock(inner) => inner.into(), | ||||
|             Element::Clock(inner) => inner.into(), | ||||
|             Element::DiarySexp(inner) => inner.into(), | ||||
|             Element::Planning(inner) => inner.into(), | ||||
|             Element::FixedWidthArea(inner) => inner.into(), | ||||
|             Element::HorizontalRule(inner) => inner.into(), | ||||
|             Element::Keyword(inner) => inner.into(), | ||||
|             Element::BabelCall(inner) => inner.into(), | ||||
|             Element::LatexEnvironment(inner) => inner.into(), | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| impl<'r, 's> From<&'r Object<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Object<'s>) -> Self { | ||||
|         match value { | ||||
|             Object::Bold(inner) => inner.into(), | ||||
|             Object::Italic(inner) => inner.into(), | ||||
|             Object::Underline(inner) => inner.into(), | ||||
|             Object::StrikeThrough(inner) => inner.into(), | ||||
|             Object::Code(inner) => inner.into(), | ||||
|             Object::Verbatim(inner) => inner.into(), | ||||
|             Object::PlainText(inner) => inner.into(), | ||||
|             Object::RegularLink(inner) => inner.into(), | ||||
|             Object::RadioLink(inner) => inner.into(), | ||||
|             Object::RadioTarget(inner) => inner.into(), | ||||
|             Object::PlainLink(inner) => inner.into(), | ||||
|             Object::AngleLink(inner) => inner.into(), | ||||
|             Object::OrgMacro(inner) => inner.into(), | ||||
|             Object::Entity(inner) => inner.into(), | ||||
|             Object::LatexFragment(inner) => inner.into(), | ||||
|             Object::ExportSnippet(inner) => inner.into(), | ||||
|             Object::FootnoteReference(inner) => inner.into(), | ||||
|             Object::Citation(inner) => inner.into(), | ||||
|             Object::CitationReference(inner) => inner.into(), | ||||
|             Object::InlineBabelCall(inner) => inner.into(), | ||||
|             Object::InlineSourceBlock(inner) => inner.into(), | ||||
|             Object::LineBreak(inner) => inner.into(), | ||||
|             Object::Target(inner) => inner.into(), | ||||
|             Object::StatisticsCookie(inner) => inner.into(), | ||||
|             Object::Subscript(inner) => inner.into(), | ||||
|             Object::Superscript(inner) => inner.into(), | ||||
|             Object::Timestamp(inner) => inner.into(), | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| impl<'r, 's> From<&'r Document<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Document<'s>) -> Self { | ||||
|         AstNode::Document(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Heading<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Heading<'s>) -> Self { | ||||
|         AstNode::Heading(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Section<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Section<'s>) -> Self { | ||||
|         AstNode::Section(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Paragraph<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Paragraph<'s>) -> Self { | ||||
|         AstNode::Paragraph(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r PlainList<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r PlainList<'s>) -> Self { | ||||
|         AstNode::PlainList(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r GreaterBlock<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r GreaterBlock<'s>) -> Self { | ||||
|         AstNode::GreaterBlock(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r DynamicBlock<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r DynamicBlock<'s>) -> Self { | ||||
|         AstNode::DynamicBlock(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r FootnoteDefinition<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r FootnoteDefinition<'s>) -> Self { | ||||
|         AstNode::FootnoteDefinition(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Comment<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Comment<'s>) -> Self { | ||||
|         AstNode::Comment(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Drawer<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Drawer<'s>) -> Self { | ||||
|         AstNode::Drawer(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r PropertyDrawer<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r PropertyDrawer<'s>) -> Self { | ||||
|         AstNode::PropertyDrawer(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Table<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Table<'s>) -> Self { | ||||
|         AstNode::Table(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r VerseBlock<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r VerseBlock<'s>) -> Self { | ||||
|         AstNode::VerseBlock(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r CommentBlock<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r CommentBlock<'s>) -> Self { | ||||
|         AstNode::CommentBlock(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r ExampleBlock<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r ExampleBlock<'s>) -> Self { | ||||
|         AstNode::ExampleBlock(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r ExportBlock<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r ExportBlock<'s>) -> Self { | ||||
|         AstNode::ExportBlock(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r SrcBlock<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r SrcBlock<'s>) -> Self { | ||||
|         AstNode::SrcBlock(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Clock<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Clock<'s>) -> Self { | ||||
|         AstNode::Clock(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r DiarySexp<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r DiarySexp<'s>) -> Self { | ||||
|         AstNode::DiarySexp(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Planning<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Planning<'s>) -> Self { | ||||
|         AstNode::Planning(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r FixedWidthArea<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r FixedWidthArea<'s>) -> Self { | ||||
|         AstNode::FixedWidthArea(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r HorizontalRule<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r HorizontalRule<'s>) -> Self { | ||||
|         AstNode::HorizontalRule(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Keyword<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Keyword<'s>) -> Self { | ||||
|         AstNode::Keyword(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r BabelCall<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r BabelCall<'s>) -> Self { | ||||
|         AstNode::BabelCall(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r LatexEnvironment<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r LatexEnvironment<'s>) -> Self { | ||||
|         AstNode::LatexEnvironment(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Bold<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Bold<'s>) -> Self { | ||||
|         AstNode::Bold(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Italic<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Italic<'s>) -> Self { | ||||
|         AstNode::Italic(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Underline<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Underline<'s>) -> Self { | ||||
|         AstNode::Underline(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r StrikeThrough<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r StrikeThrough<'s>) -> Self { | ||||
|         AstNode::StrikeThrough(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Code<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Code<'s>) -> Self { | ||||
|         AstNode::Code(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Verbatim<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Verbatim<'s>) -> Self { | ||||
|         AstNode::Verbatim(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r PlainText<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r PlainText<'s>) -> Self { | ||||
|         AstNode::PlainText(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r RegularLink<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r RegularLink<'s>) -> Self { | ||||
|         AstNode::RegularLink(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r RadioLink<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r RadioLink<'s>) -> Self { | ||||
|         AstNode::RadioLink(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r RadioTarget<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r RadioTarget<'s>) -> Self { | ||||
|         AstNode::RadioTarget(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r PlainLink<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r PlainLink<'s>) -> Self { | ||||
|         AstNode::PlainLink(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r AngleLink<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r AngleLink<'s>) -> Self { | ||||
|         AstNode::AngleLink(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r OrgMacro<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r OrgMacro<'s>) -> Self { | ||||
|         AstNode::OrgMacro(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Entity<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Entity<'s>) -> Self { | ||||
|         AstNode::Entity(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r LatexFragment<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r LatexFragment<'s>) -> Self { | ||||
|         AstNode::LatexFragment(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r ExportSnippet<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r ExportSnippet<'s>) -> Self { | ||||
|         AstNode::ExportSnippet(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r FootnoteReference<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r FootnoteReference<'s>) -> Self { | ||||
|         AstNode::FootnoteReference(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Citation<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Citation<'s>) -> Self { | ||||
|         AstNode::Citation(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r CitationReference<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r CitationReference<'s>) -> Self { | ||||
|         AstNode::CitationReference(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r InlineBabelCall<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r InlineBabelCall<'s>) -> Self { | ||||
|         AstNode::InlineBabelCall(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r InlineSourceBlock<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r InlineSourceBlock<'s>) -> Self { | ||||
|         AstNode::InlineSourceBlock(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r LineBreak<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r LineBreak<'s>) -> Self { | ||||
|         AstNode::LineBreak(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Target<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Target<'s>) -> Self { | ||||
|         AstNode::Target(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r StatisticsCookie<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r StatisticsCookie<'s>) -> Self { | ||||
|         AstNode::StatisticsCookie(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Subscript<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Subscript<'s>) -> Self { | ||||
|         AstNode::Subscript(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Superscript<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Superscript<'s>) -> Self { | ||||
|         AstNode::Superscript(value) | ||||
|     } | ||||
| } | ||||
| impl<'r, 's> From<&'r Timestamp<'s>> for AstNode<'r, 's> { | ||||
|     fn from(value: &'r Timestamp<'s>) -> Self { | ||||
|         AstNode::Timestamp(value) | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -1,63 +1,73 @@ | ||||
| use super::ast_node::AstNode; | ||||
| use crate::types::Object; | ||||
| 
 | ||||
| pub enum AstNodeIter<'s> { | ||||
| pub enum AstNodeIter<'r, 's> { | ||||
|     // Document Nodes
 | ||||
|     // Document(DocumentIter<'s>),
 | ||||
|     // Heading(HeadingIter<'s>),
 | ||||
|     // Section(SectionIter<'s>),
 | ||||
|     // Document(DocumentIter<'r, 's>),
 | ||||
|     // Heading(HeadingIter<'r, 's>),
 | ||||
|     // Section(SectionIter<'r, 's>),
 | ||||
|     // Elements
 | ||||
|     // Paragraph(ParagraphIter<'s>),
 | ||||
|     // PlainList(PlainListIter<'s>),
 | ||||
|     // GreaterBlock(GreaterBlockIter<'s>),
 | ||||
|     // DynamicBlock(DynamicBlockIter<'s>),
 | ||||
|     // FootnoteDefinition(FootnoteDefinitionIter<'s>),
 | ||||
|     // Comment(CommentIter<'s>),
 | ||||
|     // Drawer(DrawerIter<'s>),
 | ||||
|     // PropertyDrawer(PropertyDrawerIter<'s>),
 | ||||
|     // Table(TableIter<'s>),
 | ||||
|     // VerseBlock(VerseBlockIter<'s>),
 | ||||
|     // CommentBlock(CommentBlockIter<'s>),
 | ||||
|     // ExampleBlock(ExampleBlockIter<'s>),
 | ||||
|     // ExportBlock(ExportBlockIter<'s>),
 | ||||
|     // SrcBlock(SrcBlockIter<'s>),
 | ||||
|     // Clock(ClockIter<'s>),
 | ||||
|     // DiarySexp(DiarySexpIter<'s>),
 | ||||
|     // Planning(PlanningIter<'s>),
 | ||||
|     // FixedWidthArea(FixedWidthAreaIter<'s>),
 | ||||
|     // HorizontalRule(HorizontalRuleIter<'s>),
 | ||||
|     // Keyword(KeywordIter<'s>),
 | ||||
|     // BabelCall(BabelCallIter<'s>),
 | ||||
|     // LatexEnvironment(LatexEnvironmentIter<'s>),
 | ||||
|     // Paragraph(ParagraphIter<'r, 's>),
 | ||||
|     // PlainList(PlainListIter<'r, 's>),
 | ||||
|     // GreaterBlock(GreaterBlockIter<'r, 's>),
 | ||||
|     // DynamicBlock(DynamicBlockIter<'r, 's>),
 | ||||
|     // FootnoteDefinition(FootnoteDefinitionIter<'r, 's>),
 | ||||
|     // Comment(CommentIter<'r, 's>),
 | ||||
|     // Drawer(DrawerIter<'r, 's>),
 | ||||
|     // PropertyDrawer(PropertyDrawerIter<'r, 's>),
 | ||||
|     // Table(TableIter<'r, 's>),
 | ||||
|     // VerseBlock(VerseBlockIter<'r, 's>),
 | ||||
|     // CommentBlock(CommentBlockIter<'r, 's>),
 | ||||
|     // ExampleBlock(ExampleBlockIter<'r, 's>),
 | ||||
|     // ExportBlock(ExportBlockIter<'r, 's>),
 | ||||
|     // SrcBlock(SrcBlockIter<'r, 's>),
 | ||||
|     // Clock(ClockIter<'r, 's>),
 | ||||
|     // DiarySexp(DiarySexpIter<'r, 's>),
 | ||||
|     // Planning(PlanningIter<'r, 's>),
 | ||||
|     // FixedWidthArea(FixedWidthAreaIter<'r, 's>),
 | ||||
|     // HorizontalRule(HorizontalRuleIter<'r, 's>),
 | ||||
|     // Keyword(KeywordIter<'r, 's>),
 | ||||
|     // BabelCall(BabelCallIter<'r, 's>),
 | ||||
|     // LatexEnvironment(LatexEnvironmentIter<'r, 's>),
 | ||||
|     // Objects
 | ||||
|     Bold(BoldIter<'s>), | ||||
|     // Italic(ItalicIter<'s>),
 | ||||
|     // Underline(UnderlineIter<'s>),
 | ||||
|     // StrikeThrough(StrikeThroughIter<'s>),
 | ||||
|     // Code(CodeIter<'s>),
 | ||||
|     // Verbatim(VerbatimIter<'s>),
 | ||||
|     // PlainText(PlainTextIter<'s>),
 | ||||
|     // RegularLink(RegularLinkIter<'s>),
 | ||||
|     // RadioLink(RadioLinkIter<'s>),
 | ||||
|     // RadioTarget(RadioTargetIter<'s>),
 | ||||
|     // PlainLink(PlainLinkIter<'s>),
 | ||||
|     // AngleLink(AngleLinkIter<'s>),
 | ||||
|     // OrgMacro(OrgMacroIter<'s>),
 | ||||
|     // Entity(EntityIter<'s>),
 | ||||
|     // LatexFragment(LatexFragmentIter<'s>),
 | ||||
|     // ExportSnippet(ExportSnippetIter<'s>),
 | ||||
|     // FootnoteReference(FootnoteReferenceIter<'s>),
 | ||||
|     // Citation(CitationIter<'s>),
 | ||||
|     // CitationReference(CitationReferenceIter<'s>),
 | ||||
|     // InlineBabelCall(InlineBabelCallIter<'s>),
 | ||||
|     // InlineSourceBlock(InlineSourceBlockIter<'s>),
 | ||||
|     // LineBreak(LineBreakIter<'s>),
 | ||||
|     // Target(TargetIter<'s>),
 | ||||
|     // StatisticsCookie(StatisticsCookieIter<'s>),
 | ||||
|     // Subscript(SubscriptIter<'s>),
 | ||||
|     // Superscript(SuperscriptIter<'s>),
 | ||||
|     // Timestamp(TimestampIter<'s>),
 | ||||
|     Bold(BoldIter<'r, 's>), | ||||
|     // Italic(ItalicIter<'r, 's>),
 | ||||
|     // Underline(UnderlineIter<'r, 's>),
 | ||||
|     // StrikeThrough(StrikeThroughIter<'r, 's>),
 | ||||
|     // Code(CodeIter<'r, 's>),
 | ||||
|     // Verbatim(VerbatimIter<'r, 's>),
 | ||||
|     // PlainText(PlainTextIter<'r, 's>),
 | ||||
|     // RegularLink(RegularLinkIter<'r, 's>),
 | ||||
|     // RadioLink(RadioLinkIter<'r, 's>),
 | ||||
|     // RadioTarget(RadioTargetIter<'r, 's>),
 | ||||
|     // PlainLink(PlainLinkIter<'r, 's>),
 | ||||
|     // AngleLink(AngleLinkIter<'r, 's>),
 | ||||
|     // OrgMacro(OrgMacroIter<'r, 's>),
 | ||||
|     // Entity(EntityIter<'r, 's>),
 | ||||
|     // LatexFragment(LatexFragmentIter<'r, 's>),
 | ||||
|     // ExportSnippet(ExportSnippetIter<'r, 's>),
 | ||||
|     // FootnoteReference(FootnoteReferenceIter<'r, 's>),
 | ||||
|     // Citation(CitationIter<'r, 's>),
 | ||||
|     // CitationReference(CitationReferenceIter<'r, 's>),
 | ||||
|     // InlineBabelCall(InlineBabelCallIter<'r, 's>),
 | ||||
|     // InlineSourceBlock(InlineSourceBlockIter<'r, 's>),
 | ||||
|     // LineBreak(LineBreakIter<'r, 's>),
 | ||||
|     // Target(TargetIter<'r, 's>),
 | ||||
|     // StatisticsCookie(StatisticsCookieIter<'r, 's>),
 | ||||
|     // Subscript(SubscriptIter<'r, 's>),
 | ||||
|     // Superscript(SuperscriptIter<'r, 's>),
 | ||||
|     // Timestamp(TimestampIter<'r, 's>),
 | ||||
| } | ||||
| 
 | ||||
| pub struct BoldIter<'s> { | ||||
|     next: std::slice::Iter<'s, Object<'s>>, | ||||
| pub struct BoldIter<'r, 's> { | ||||
|     next: std::slice::Iter<'r, Object<'s>>, | ||||
| } | ||||
| 
 | ||||
| impl<'r, 's> Iterator for BoldIter<'r, 's> { | ||||
|     type Item = AstNode<'r, 's>; | ||||
| 
 | ||||
|     fn next(&mut self) -> Option<Self::Item> { | ||||
|         let foo = self.next.next(); | ||||
|         todo!() | ||||
|     } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander