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
impl ParseTarget
pub fn set_template(&mut self, template: &str)
pub fn set_script( &mut self, content: &str, lang: Option<String>, ) -> Result<(), Error>
pub fn set_style(&mut self, style: &str)
pub fn set_comment(&mut self, comment: Vec<OfflineComment>)
pub fn push_comment(&mut self, comment: OfflineComment)
pub fn template(&self) -> Option<&String>
pub fn script(&self) -> Option<&Script>
pub fn style(&self) -> Option<&String>
pub fn comment(&self) -> Option<&Vec<OfflineComment>>
pub fn has_template(&self) -> (bool, bool)
pub fn has_script(&self) -> (bool, bool)
pub fn has_style(&self) -> (bool, bool)
Sourcepub fn has_comment(&self) -> (bool, bool)
pub fn has_comment(&self) -> (bool, bool)
judge whether has other comments
pub fn has(&self) -> (bool, bool, bool, bool)
Sourcepub fn handle_self(&mut self)
pub fn handle_self(&mut self)
Sourcepub fn target_strategy(&self) -> Strategy
pub fn target_strategy(&self) -> Strategy
Get ParseTarget Convert to AST Strategy This strategy affects how many threads are used for conversion
- no tag and no