Struct syntect::highlighting::ThemeSet
source · pub struct ThemeSet {
pub themes: BTreeMap<String, Theme>,
}
Fields§
§themes: BTreeMap<String, Theme>
Implementations§
source§impl 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§
source§impl<'de> Deserialize<'de> for ThemeSet
impl<'de> Deserialize<'de> for ThemeSet
source§fn 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