pub struct Options {
pub theme_mode: ThemeMode,
pub fonts: FontConfig,
pub locales: LocalesConfig,
}Expand description
Complete options for initializing Liora core state.
Fields§
§theme_mode: ThemeModeStartup theme mode. Defaults to following the operating system.
fonts: FontConfigOptional app typography overrides. Defaults to system font families and weights.
locales: LocalesConfigRuntime locale resources config. Defaults to en-US with built-in fallback resources.
Implementations§
Source§impl Options
impl Options
Sourcepub fn system() -> Self
pub fn system() -> Self
Creates options that follow the operating-system theme and font choices.
Sourcepub fn with_theme_mode(self, mode: ThemeMode) -> Self
pub fn with_theme_mode(self, mode: ThemeMode) -> Self
Returns options with an explicit theme mode.
Sourcepub fn with_fonts(self, fonts: FontConfig) -> Self
pub fn with_fonts(self, fonts: FontConfig) -> Self
Returns options with custom Liora font families and default weights.
Sourcepub fn with_locale(self, locale: impl Into<LocaleId>) -> Self
pub fn with_locale(self, locale: impl Into<LocaleId>) -> Self
Returns options with an active locale.
Sourcepub fn with_fallback_locale(self, locale: impl Into<LocaleId>) -> Self
pub fn with_fallback_locale(self, locale: impl Into<LocaleId>) -> Self
Returns options with a fallback locale.
Sourcepub fn with_locales(self, locales: LocalesConfig) -> Self
pub fn with_locales(self, locales: LocalesConfig) -> Self
Returns options with a complete locales config.
Sourcepub fn with_locales_resources(self, resources: LocalesMap) -> Self
pub fn with_locales_resources(self, resources: LocalesMap) -> Self
Returns options with file-backed locales resources.
Sourcepub fn try_with_locales_dir(
self,
dir: impl AsRef<Path>,
) -> Result<Self, LocalesLoadError>
pub fn try_with_locales_dir( self, dir: impl AsRef<Path>, ) -> Result<Self, LocalesLoadError>
Loads all TOML language files from dir and returns options using them.
Sourcepub fn with_translator(self, translator: impl Translator + 'static) -> Self
pub fn with_translator(self, translator: impl Translator + 'static) -> Self
Returns options with a custom translator. The translator is consulted before file-backed resources.
Returns options with a shared custom translator.
Trait Implementations§
impl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl !RefUnwindSafe for Options
impl !UnwindSafe for Options
impl Freeze for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().