Struct tree_sitter_highlight::HtmlRenderer
source · pub struct HtmlRenderer {
pub html: Vec<u8>,
pub line_offsets: Vec<u32>,
/* private fields */
}
Expand description
Converts a general-purpose syntax highlighting iterator into a sequence of lines of HTML.
Fields§
§html: Vec<u8>
§line_offsets: Vec<u32>
Implementations§
source§impl HtmlRenderer
impl HtmlRenderer
pub fn new() -> Self
pub fn set_carriage_return_highlight(&mut self, highlight: Option<Highlight>)
pub fn reset(&mut self)
pub fn render<'a, F>( &mut self, highlighter: impl Iterator<Item = Result<HighlightEvent, Error>>, source: &'a [u8], attribute_callback: &F ) -> Result<(), Error>
pub fn lines(&self) -> impl Iterator<Item = &str>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HtmlRenderer
impl RefUnwindSafe for HtmlRenderer
impl Send for HtmlRenderer
impl Sync for HtmlRenderer
impl Unpin for HtmlRenderer
impl UnwindSafe for HtmlRenderer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more