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