pub struct ThemeSet {
    pub themes: BTreeMap<String, Theme>,
}

Fields§

§themes: BTreeMap<String, Theme>

Implementations§

source§

impl ThemeSet

source

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 here
  • Solarized (dark) and Solarized (light)
source§

impl ThemeSet

A set of themes, includes convenient methods for loading and discovering themes.

source

pub fn new() -> ThemeSet

Creates an empty set

source

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

source

pub fn get_theme<P: AsRef<Path>>(path: P) -> Result<Theme, LoadingError>

Loads a theme given a path to a .tmTheme file

source

pub fn load_from_reader<R: BufRead + Seek>( r: &mut R ) -> Result<Theme, LoadingError>

Loads a theme given a readable stream

source

pub fn load_from_folder<P: AsRef<Path>>( folder: P ) -> Result<ThemeSet, LoadingError>

Generate a ThemeSet from all themes in a folder

source

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 Debug for ThemeSet

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ThemeSet

source§

fn default() -> ThemeSet

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ThemeSet

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for ThemeSet

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,