Struct LaunchOptionsBuilder

Source
pub struct LaunchOptionsBuilder { /* private fields */ }
Expand description

Builder for LaunchOptions.

Implementations§

Source§

impl LaunchOptionsBuilder

Source

pub fn launcher_name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Name of the launcher that gets passed as a game argument.

Defaults to the crates name.

Source

pub fn launcher_version<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

Version of the launcher that gets passed as a game argument.

Defaults to the crates version.

Source

pub fn player_name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Player name for the game.

Defaults to Steve.

Source

pub fn profile_id(&mut self, value: String) -> &mut Self

The profile ID. This is needed for online mode.

Default to None.

Source

pub fn token(&mut self, value: String) -> &mut Self

The minecraft access token. This is needed for online mode.

Defaults to None.

Source

pub fn fullscreen(&mut self, value: bool) -> &mut Self

Enables fullscreen. Overwrites the custom window size.

Defaults to false.

Source

pub fn enable_custom_window_size(&mut self, value: bool) -> &mut Self

Enables custom window size. Takes effect when not launching in fullscreen. The width and height can be configured with custom_width and custom_height.

Defaults to false.

Source

pub fn custom_width(&mut self, value: u32) -> &mut Self

Custom game window width. Used when enable_custom_window_size is enabled.

Defaults to 1280.

Source

pub fn custom_height(&mut self, value: u32) -> &mut Self

Custom game window height. Used when enable_custom_window_size is enabled.

Defaults to 720.

Source

pub fn enable_custom_memory(&mut self, value: bool) -> &mut Self

Enables custom JVM memory restrictions. The minimum and maximum can be configured with custom_min_memory and custom_max_memory.

Defaults to false.

Source

pub fn custom_min_memory(&mut self, value: u32) -> &mut Self

JVM initial heap size in megabytes. Adds the -Xms option to the command. Gets added before custom_jvm_args. Used when enable_custom_memory is enabled.

Defaults to 1024.

Source

pub fn custom_max_memory(&mut self, value: u32) -> &mut Self

JVM max heap size in megabytes. Adds the -Xmx option to the command. Gets added before custom_jvm_args. Used when enable_custom_memory` is enabled.

Defaults to 2048.

Source

pub fn java_executable<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

Java executable.

Defaults to java.

Source

pub fn custom_jvm_arguments<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut Self

Custom JVM arguments

Defaults to None.

Source

pub fn environment_variables( &mut self, value: Vec<(String, Option<String>)>, ) -> &mut Self

Environment variables used for launching the game.

Defaults to vec![].

Source§

impl LaunchOptionsBuilder

Source

pub fn build(&self) -> LaunchOptions

Builds new LaunchOptions.

Trait Implementations§

Source§

impl Clone for LaunchOptionsBuilder

Source§

fn clone(&self) -> LaunchOptionsBuilder

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

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

Performs copy-assignment from source. Read more
Source§

impl Default for LaunchOptionsBuilder

Source§

fn default() -> Self

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

Auto Trait Implementations§

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.

Source§

impl<T> Instrument for T

Source§

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

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

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.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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
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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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