Struct HtmlPlugin

Source
pub struct HtmlPlugin {
    pub chars: Vec<char>,
    pub index: usize,
    pub last_item_end: usize,
    pub template: Template,
    pub source_root_path: Option<Rc<PathBuf>>,
    pub output_root_path: Option<Rc<PathBuf>>,
    pub default_variables: HashMap<String, String>,
    pub tag_logics: Vec<Rc<dyn TagLogic>>,
    pub dependencies: Vec<Rc<PathBuf>>,
}

Fields§

§chars: Vec<char>§index: usize§last_item_end: usize§template: Template§source_root_path: Option<Rc<PathBuf>>§output_root_path: Option<Rc<PathBuf>>§default_variables: HashMap<String, String>§tag_logics: Vec<Rc<dyn TagLogic>>§dependencies: Vec<Rc<PathBuf>>

Implementations§

Source§

impl HtmlPlugin

Source

pub fn new() -> HtmlPlugin

Source

pub fn reset(&mut self)

Source

pub fn read_file(&mut self, path: impl AsRef<Path>) -> Result<(), HtmlError>

Source

pub fn parse_file(&mut self, file: &mut File) -> Result<(), HtmlError>

Source

pub fn parse(&mut self) -> Result<(), HtmlError>

Source

pub fn parse_remaining_as_text(&mut self)

Source

pub fn parse_comment(&mut self)

Source

pub fn parse_opening_tag(&mut self) -> Result<bool, HtmlError>

Source

pub fn parse_closing_tag(&mut self) -> Result<bool, HtmlError>

Source

pub fn parse_attributes(&mut self) -> Result<(Attributes, bool), HtmlError>

Source

pub fn process(&self, context: &mut TemplateContext)

Source

pub fn try_find(&self, text: &[char]) -> Option<usize>

Source

pub fn next_is(&self, text: &[char]) -> bool

Source

pub fn peek(&self, len: usize) -> Option<&[char]>

Source

pub fn is_eof(&self) -> bool

Trait Implementations§

Source§

impl Debug for HtmlPlugin

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HtmlPlugin

Source§

fn default() -> HtmlPlugin

Returns the “default value” for a type. Read more
Source§

impl Plugin for HtmlPlugin

Source§

fn extensions(&self) -> &[&str]

Source§

fn prepare(&mut self, context: &PluginContext)

Source§

fn process_file_to( &mut self, source_file: File, output_file: File, ) -> Result<(), Box<dyn Error>>

Source§

fn reset(&mut self)

Source§

fn get_dependencies(&mut self) -> Option<Vec<Rc<PathBuf>>>

Source§

fn init(&mut self, context: &PluginContext)

Source§

fn is_valid_extension(&self, extension: &str) -> bool

Source§

impl TryFrom<&Path> for HtmlPlugin

Source§

type Error = HtmlError

The type returned in the event of a conversion error.
Source§

fn try_from(path: &Path) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.