Enum Theme

Source
pub enum Theme {
Show 23 variants Light, Dark, Dracula, Nord, SolarizedLight, SolarizedDark, GruvboxLight, GruvboxDark, CatppuccinLatte, CatppuccinFrappe, CatppuccinMacchiato, CatppuccinMocha, TokyoNight, TokyoNightStorm, TokyoNightLight, KanagawaWave, KanagawaDragon, KanagawaLotus, Moonfly, Nightfly, Oxocarbon, Ferra, Custom(Arc<Custom>),
}
Expand description

A built-in theme.

Variants§

§

Light

The built-in light variant.

§

Dark

The built-in dark variant.

§

Dracula

The built-in Dracula variant.

§

Nord

The built-in Nord variant.

§

SolarizedLight

The built-in Solarized Light variant.

§

SolarizedDark

The built-in Solarized Dark variant.

§

GruvboxLight

The built-in Gruvbox Light variant.

§

GruvboxDark

The built-in Gruvbox Dark variant.

§

CatppuccinLatte

The built-in Catppuccin Latte variant.

§

CatppuccinFrappe

The built-in Catppuccin Frappé variant.

§

CatppuccinMacchiato

The built-in Catppuccin Macchiato variant.

§

CatppuccinMocha

The built-in Catppuccin Mocha variant.

§

TokyoNight

The built-in Tokyo Night variant.

§

TokyoNightStorm

The built-in Tokyo Night Storm variant.

§

TokyoNightLight

The built-in Tokyo Night Light variant.

§

KanagawaWave

The built-in Kanagawa Wave variant.

§

KanagawaDragon

The built-in Kanagawa Dragon variant.

§

KanagawaLotus

The built-in Kanagawa Lotus variant.

§

Moonfly

The built-in Moonfly variant.

§

Nightfly

The built-in Nightfly variant.

§

Oxocarbon

The built-in Oxocarbon variant.

§

Ferra

The built-in Ferra variant:

§

Custom(Arc<Custom>)

A Theme that uses a Custom palette.

Implementations§

Source§

impl Theme

Source

pub const ALL: &'static [Self]

A list with all the defined themes.

Source

pub fn custom(name: impl Into<Cow<'static, str>>, palette: Palette) -> Self

Creates a new custom Theme from the given Palette.

Source

pub fn custom_with_fn( name: impl Into<Cow<'static, str>>, palette: Palette, generate: impl FnOnce(Palette) -> Extended, ) -> Self

Creates a new custom Theme from the given Palette, with a custom generator of a palette::Extended.

Source

pub fn palette(&self) -> Palette

Returns the Palette of the Theme.

Source

pub fn extended_palette(&self) -> &Extended

Returns the palette::Extended of the Theme.

Trait Implementations§

Source§

impl Base for Theme

Source§

fn base(&self) -> Style

Returns the default base Style of a theme.
Source§

fn palette(&self) -> Option<Palette>

Returns the color Palette of the theme. Read more
Source§

impl Catalog for Theme

Source§

type Class<'a> = Box<dyn Fn(&Theme) -> Style + 'a>

The item class of this Catalog.
Source§

fn default<'a>() -> Self::Class<'a>

The default class produced by this Catalog.
Source§

fn style(&self, class: &Self::Class<'_>) -> Style

The Style of a class with the given status.
Source§

impl Clone for Theme

Source§

fn clone(&self) -> Theme

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Theme

Source§

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

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

impl Default for Theme

Source§

fn default() -> Self

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

impl Display for Theme

Source§

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

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

impl PartialEq for Theme

Source§

fn eq(&self, other: &Theme) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Theme

Auto Trait Implementations§

§

impl Freeze for Theme

§

impl RefUnwindSafe for Theme

§

impl Send for Theme

§

impl Sync for Theme

§

impl Unpin for Theme

§

impl UnwindSafe for Theme

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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>,

Source§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T