Struct cobalt::SyntaxHighlight
source · pub struct SyntaxHighlight { /* private fields */ }Expand description
Highlight code block
Implementations§
source§impl Syntax
impl Syntax
pub fn new() -> Syntax
pub fn load_custom_syntaxes(&mut self, syntaxes_path: &Path)
pub fn has_theme(&self, name: &str) -> bool
pub fn themes(&self) -> impl Iterator<Item = String>
pub fn syntaxes(&self) -> impl Iterator<Item = String>
pub fn default_theme(&self) -> Option<&str>
pub fn set_default_theme(&mut self, theme: impl Into<String>)
pub fn format( &self, code: &str, lang: Option<&str>, theme: Option<&str> ) -> String
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Syntax
impl Send for Syntax
impl Sync for Syntax
impl Unpin for Syntax
impl UnwindSafe for Syntax
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