#[non_exhaustive]pub struct Syntax { /* private fields */ }
Available on crate feature
syntax
only.Expand description
Highlight code block
Implementations§
source§impl Syntax
impl Syntax
pub fn new() -> Self
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 !Freeze for Syntax
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