#[non_exhaustive]pub struct LaunchContext {
pub os: HostOs,
pub store: StorePlatform,
pub runtime: Runtime,
pub mode: LaunchMode,
pub extra_args: Vec<String>,
}Expand description
The platform facts a launch computation needs, supplied by the caller.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.os: HostOsThe operating system the game will run on. Supplied rather than detected so
every combination stays testable; HostOs::detect is the caller’s opt-in.
store: StorePlatformHow the game is distributed, which decides what process is started and
whether the environment in LaunchPlan::env can reach the game at all.
runtime: RuntimeWhether the game runs natively or under Proton/Wine, which decides whether paths in the computed argv are Unix- or Windows-shaped.
mode: LaunchModeWhether to inject the loader or start the game vanilla.
extra_args: Vec<String>Caller/user-supplied arguments, appended after the loader’s own.
Implementations§
Source§impl LaunchContext
impl LaunchContext
Sourcepub fn new(
os: HostOs,
store: StorePlatform,
runtime: Runtime,
mode: LaunchMode,
) -> Self
pub fn new( os: HostOs, store: StorePlatform, runtime: Runtime, mode: LaunchMode, ) -> Self
Builds a LaunchContext with an empty extra_args.
LaunchContext is #[non_exhaustive], so outside this crate it cannot be
built with a struct literal, nor updated with functional-update (..)
syntax — both are struct-literal forms and #[non_exhaustive] forbids both
from other crates. This constructor is the supported way for a downstream
crate (including this crate’s own tests/*.rs, which compile as separate
crates) to construct one; use Self::with_extra_args to add extras.
Sourcepub fn with_extra_args(self, extra_args: Vec<String>) -> Self
pub fn with_extra_args(self, extra_args: Vec<String>) -> Self
Returns self with extra_args replaced, for chaining after Self::new.
Trait Implementations§
Source§impl Clone for LaunchContext
impl Clone for LaunchContext
Source§fn clone(&self) -> LaunchContext
fn clone(&self) -> LaunchContext
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 LaunchContext
impl Debug for LaunchContext
impl Eq for LaunchContext
Source§impl PartialEq for LaunchContext
impl PartialEq for LaunchContext
impl StructuralPartialEq for LaunchContext
Auto Trait Implementations§
impl Freeze for LaunchContext
impl RefUnwindSafe for LaunchContext
impl Send for LaunchContext
impl Sync for LaunchContext
impl Unpin for LaunchContext
impl UnsafeUnpin for LaunchContext
impl UnwindSafe for LaunchContext
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
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,
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§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.