pub struct PulldownHighlighter { /* private fields */ }Implementations§
Source§impl PulldownHighlighter
A highlighter that can be instantiated once and used many times for better performance.
impl PulldownHighlighter
A highlighter that can be instantiated once and used many times for better performance.
pub fn new(theme: &str) -> Result<PulldownHighlighter, Error>
Sourcepub fn highlight<'a, It>(&self, events: It) -> Result<Vec<Event<'a>>, Error>
pub fn highlight<'a, It>(&self, events: It) -> Result<Vec<Event<'a>>, Error>
Apply syntax highlighting to pulldown-cmark events using this instance’s theme.
Take an iterator over pulldown-cmark’s events, and (on success) return a new iterator where code blocks have been turned into HTML text blocks with syntax highlighting.
Implementation based on https://github.com/raphlinus/pulldown-cmark/issues/167#issuecomment-448491422.
Auto Trait Implementations§
impl !Freeze for PulldownHighlighter
impl RefUnwindSafe for PulldownHighlighter
impl Send for PulldownHighlighter
impl Sync for PulldownHighlighter
impl Unpin for PulldownHighlighter
impl UnwindSafe for PulldownHighlighter
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