pub struct ThemeConfig {
pub name: String,
pub author: String,
pub homepage: String,
pub description: String,
pub preview: Option<String>,
pub parent: Option<String>,
pub require: Vec<String>,
pub form: Option<FormConfig>,
}Expand description
A theme’s config: the YAML an operator edits, parsed on every save.
form declares the theme’s own settings fields; parent names the theme
whose templates fill in for the ones this theme lacks; require lists the
modules the theme’s templates need.
Fields§
§name: String§homepage: String§description: String§preview: Option<String>A URL for the theme’s preview image, shown on the theme list; unset, the list shows the theme’s initials.
parent: Option<String>§require: Vec<String>§form: Option<FormConfig>Implementations§
Source§impl ThemeConfig
impl ThemeConfig
Sourcepub fn parse(yaml: &str) -> Result<Self, ThemeError>
pub fn parse(yaml: &str) -> Result<Self, ThemeError>
Parses a theme’s YAML config. A form field named like one of the
theme value’s own keys (code, name, author, homepage,
description) is refused, since the settings render beside them.
Sourcepub fn to_yaml(&self) -> Result<String, ThemeError>
pub fn to_yaml(&self) -> Result<String, ThemeError>
Renders the config as YAML, the form a new theme’s row starts from.
Trait Implementations§
Source§impl Clone for ThemeConfig
impl Clone for ThemeConfig
Source§impl Debug for ThemeConfig
impl Debug for ThemeConfig
Source§impl Default for ThemeConfig
impl Default for ThemeConfig
Source§impl<'de> Deserialize<'de> for ThemeConfigwhere
ThemeConfig: Default,
impl<'de> Deserialize<'de> for ThemeConfigwhere
ThemeConfig: Default,
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 Freeze for ThemeConfig
impl RefUnwindSafe for ThemeConfig
impl Send for ThemeConfig
impl Sync for ThemeConfig
impl Unpin for ThemeConfig
impl UnsafeUnpin for ThemeConfig
impl UnwindSafe for ThemeConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more