pub struct LauncherConfig {
pub renderer: Option<String>,
pub news: NewsConfig,
pub account: Option<AccountConfig>,
/* private fields */
}Expand description
Configuration persisted in .supreme/launcher_config.json.
Uses #[serde(flatten)] to preserve any unknown keys (like settings written
by other tools) when saving.
Fields§
§renderer: Option<String>Renderer setting (e.g., “wgpu” or “glow”).
news: NewsConfigNews-related configuration.
account: Option<AccountConfig>The logged-in tournament account (the logged-in player mode).
None = guest mode. The record is the launcher’s own (it outlives
any single mod), while the identity’s WIRE form (user id + device
key) is additionally written into the tournament mod’s hidden
parameters so the managed push URLs can interpolate it.
Implementations§
Source§impl LauncherConfig
impl LauncherConfig
Sourcepub fn load(game_path: impl AsRef<Path>) -> Self
pub fn load(game_path: impl AsRef<Path>) -> Self
Load from .supreme/launcher_config.json.
If that file doesn’t exist, it will attempt to migrate from the legacy
location display_config.json.
Missing file or missing keys are silently treated as default. Also handles migration of legacy root-level news keys within the file content.
Sourcepub fn save(&self) -> Result<()>
pub fn save(&self) -> Result<()>
Persist the configuration back to .supreme/launcher_config.json.
Because of #[serde(flatten)], all other keys in the file are preserved.
pub fn path(&self) -> &Path
pub fn set_path(&mut self, path: impl Into<PathBuf>)
Trait Implementations§
Source§impl Clone for LauncherConfig
impl Clone for LauncherConfig
Source§fn clone(&self) -> LauncherConfig
fn clone(&self) -> LauncherConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LauncherConfig
impl Debug for LauncherConfig
Source§impl Default for LauncherConfig
impl Default for LauncherConfig
Source§impl<'de> Deserialize<'de> for LauncherConfig
impl<'de> Deserialize<'de> for LauncherConfig
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>,
Auto Trait Implementations§
impl Freeze for LauncherConfig
impl RefUnwindSafe for LauncherConfig
impl Send for LauncherConfig
impl Sync for LauncherConfig
impl Unpin for LauncherConfig
impl UnsafeUnpin for LauncherConfig
impl UnwindSafe for LauncherConfig
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,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more