Struct syntect::highlighting::ThemeSet
source · [−]Fields
themes: BTreeMap<String, Theme>
Implementations
sourceimpl ThemeSet
impl ThemeSet
sourcepub fn load_defaults() -> ThemeSet
pub fn load_defaults() -> ThemeSet
Loads the set of default themes Currently includes (these are the keys for the map):
base16-ocean.dark
,base16-eighties.dark
,base16-mocha.dark
,base16-ocean.light
InspiredGitHub
from hereSolarized (dark)
andSolarized (light)
sourceimpl ThemeSet
impl ThemeSet
A set of themes, includes convenient methods for loading and discovering themes.
sourcepub fn discover_theme_paths<P: AsRef<Path>>(
folder: P
) -> Result<Vec<PathBuf>, LoadingError>
pub fn discover_theme_paths<P: AsRef<Path>>(
folder: P
) -> Result<Vec<PathBuf>, LoadingError>
Returns all the themes found in a folder
This is god for enumerating before loading one with get_theme
sourcepub fn get_theme<P: AsRef<Path>>(path: P) -> Result<Theme, LoadingError>
pub fn get_theme<P: AsRef<Path>>(path: P) -> Result<Theme, LoadingError>
Loads a theme given a path to a .tmTheme file
sourcepub fn load_from_reader<R: BufRead + Seek>(
r: &mut R
) -> Result<Theme, LoadingError>
pub fn load_from_reader<R: BufRead + Seek>(
r: &mut R
) -> Result<Theme, LoadingError>
Loads a theme given a readable stream
sourcepub fn load_from_folder<P: AsRef<Path>>(
folder: P
) -> Result<ThemeSet, LoadingError>
pub fn load_from_folder<P: AsRef<Path>>(
folder: P
) -> Result<ThemeSet, LoadingError>
Generate a ThemeSet
from all themes in a folder
sourcepub fn add_from_folder<P: AsRef<Path>>(
&mut self,
folder: P
) -> Result<(), LoadingError>
pub fn add_from_folder<P: AsRef<Path>>(
&mut self,
folder: P
) -> Result<(), LoadingError>
Load all the themes in the folder into this ThemeSet
Trait Implementations
sourceimpl<'de> Deserialize<'de> for ThemeSet
impl<'de> Deserialize<'de> for ThemeSet
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for ThemeSet
impl Send for ThemeSet
impl Sync for ThemeSet
impl Unpin for ThemeSet
impl UnwindSafe for ThemeSet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more