Struct ParseTarget

Source
pub struct ParseTarget { /* private fields */ }
Expand description

§Parse Target

The target which will be parsed

Through this structure, you can obtain the page structure

§how to get

use nom to split the gen file

§target check

When calling to determine the existence of fields in the parsing target, the actual content will be determined to be empty or not

reject cheat syntax

§Example

let input = r#" ... "#;
let target = ParseTarget::try_from(input).unwrap();

Implementations§

Source§

impl ParseTarget

Source

pub fn set_template(&mut self, template: &str)

Source

pub fn set_script( &mut self, content: &str, lang: Option<String>, ) -> Result<(), Error>

Source

pub fn set_style(&mut self, style: &str)

Source

pub fn set_comment(&mut self, comment: Vec<OfflineComment>)

Source

pub fn push_comment(&mut self, comment: OfflineComment)

Source

pub fn template(&self) -> Option<&String>

Source

pub fn script(&self) -> Option<&Script>

Source

pub fn style(&self) -> Option<&String>

Source

pub fn comment(&self) -> Option<&Vec<OfflineComment>>

Source

pub fn has_template(&self) -> (bool, bool)

Source

pub fn has_script(&self) -> (bool, bool)

Source

pub fn has_style(&self) -> (bool, bool)

Source

pub fn has_comment(&self) -> (bool, bool)

judge whether has other comments

Source

pub fn has(&self) -> (bool, bool, bool, bool)

Source

pub fn handle_self(&mut self)

§handle Self to be better

Call in TryFrom trait

§which need to handle

is empty but not none

Source

pub fn target_strategy(&self) -> Strategy

Get ParseTarget Convert to AST Strategy This strategy affects how many threads are used for conversion

  1. no