VersionBuilder

Struct VersionBuilder 

Source
pub struct VersionBuilder<'a, L = ()> {
    pub name: String,
    pub loader: L,
    pub loader_version: String,
    pub minecraft_version: String,
    pub project_dirs: &'a Lazy<ProjectDirs>,
    pub game_dirs: PathBuf,
    pub java_dirs: PathBuf,
}
Expand description

Structure principale pour configurer une version Minecraft avec un loader

§Exemples

use lighty_version::VersionBuilder;
use lighty_loaders::types::Loader;

let builder = VersionBuilder::new("my-profile", Loader::Vanilla, "0.15.0", "1.20.1", &PROJECT_DIRS);

// Ou avec le builder pattern:
let builder = VersionBuilder::new("my-profile", Loader::Vanilla, "0.15.0", "1.20.1", &PROJECT_DIRS)
    .with_custom_game_dir(PathBuf::from("./games"))
    .with_custom_java_dir(PathBuf::from("./java"));

Fields§

§name: String§loader: L§loader_version: String§minecraft_version: String§project_dirs: &'a Lazy<ProjectDirs>§game_dirs: PathBuf§java_dirs: PathBuf

Implementations§

Source§

impl<'a, L> VersionBuilder<'a, L>

Source

pub fn new( name: &str, loader: L, loader_version: &str, minecraft_version: &str, project_dirs: &'a Lazy<ProjectDirs>, ) -> Self

Crée un nouveau VersionBuilder avec les paramètres par défaut

Les répertoires par défaut sont :

  • game_dirs: {data_dir}/{name}
  • java_dirs: {config_dir}/jre
Source

pub fn with_custom_game_dir(self, game_dir: PathBuf) -> Self

Définit un répertoire de jeu personnalisé

§Exemple
let builder = VersionBuilder::new(...)
    .with_custom_game_dir(PathBuf::from("./custom/games"));
Source

pub fn with_custom_java_dir(self, java_dir: PathBuf) -> Self

Définit un répertoire Java personnalisé

§Exemple
let builder = VersionBuilder::new(...)
    .with_custom_java_dir(PathBuf::from("./custom/java"));
Source

pub fn with_loader(self, loader: L) -> Self

Change le loader

Source

pub fn with_loader_version(self, version: &str) -> Self

Change la version du loader

Source

pub fn with_minecraft_version(self, version: &str) -> Self

Change la version de Minecraft

Trait Implementations§

Source§

impl<'a, L: Clone> Clone for VersionBuilder<'a, L>

Source§

fn clone(&self) -> VersionBuilder<'a, L>

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl<'a, L: Debug> Debug for VersionBuilder<'a, L>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, 'b, L: Clone + Send + Sync + Debug> VersionInfo for &'b VersionBuilder<'a, L>

Source§

type LoaderType = L

Type du loader utilisé (Vanilla, Fabric, NeoForge, etc.)
Source§

fn name(&self) -> &str

Nom de la version (identifiant unique du profil)
Source§

fn loader_version(&self) -> &str

Version du loader (ou URL du serveur pour LightyVersion) Read more
Source§

fn minecraft_version(&self) -> &str

Version de Minecraft Read more
Source§

fn game_dirs(&self) -> &Path

Répertoire de jeu (contient les assets, libraries, versions, etc.)
Source§

fn java_dirs(&self) -> &Path

Répertoire Java (contient les installations JRE)
Source§

fn loader(&self) -> &Self::LoaderType

Retourne le loader utilisé
Source§

fn game_dir_exists(&self) -> bool

Vérifie si le répertoire de jeu existe
Source§

fn java_dir_exists(&self) -> bool

Vérifie si le répertoire Java existe
Source§

fn full_identifier(&self) -> String

Retourne un identifiant complet de la version Read more
Source§

fn paths(&self) -> (&Path, &Path)

Retourne les chemins importants sous forme de tuple Read more
Source§

impl<'a, L: Clone + Send + Sync + Debug> VersionInfo for VersionBuilder<'a, L>

Source§

type LoaderType = L

Type du loader utilisé (Vanilla, Fabric, NeoForge, etc.)
Source§

fn name(&self) -> &str

Nom de la version (identifiant unique du profil)
Source§

fn loader_version(&self) -> &str

Version du loader (ou URL du serveur pour LightyVersion) Read more
Source§

fn minecraft_version(&self) -> &str

Version de Minecraft Read more
Source§

fn game_dirs(&self) -> &Path

Répertoire de jeu (contient les assets, libraries, versions, etc.)
Source§

fn java_dirs(&self) -> &Path

Répertoire Java (contient les installations JRE)
Source§

fn loader(&self) -> &Self::LoaderType

Retourne le loader utilisé
Source§

fn game_dir_exists(&self) -> bool

Vérifie si le répertoire de jeu existe
Source§

fn java_dir_exists(&self) -> bool

Vérifie si le répertoire Java existe
Source§

fn full_identifier(&self) -> String

Retourne un identifiant complet de la version Read more
Source§

fn paths(&self) -> (&Path, &Path)

Retourne les chemins importants sous forme de tuple Read more

Auto Trait Implementations§

§

impl<'a, L> Freeze for VersionBuilder<'a, L>
where L: Freeze,

§

impl<'a, L> RefUnwindSafe for VersionBuilder<'a, L>
where L: RefUnwindSafe,

§

impl<'a, L> Send for VersionBuilder<'a, L>
where L: Send,

§

impl<'a, L> Sync for VersionBuilder<'a, L>
where L: Sync,

§

impl<'a, L> Unpin for VersionBuilder<'a, L>
where L: Unpin,

§

impl<'a, L> UnwindSafe for VersionBuilder<'a, L>
where L: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

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
§

impl<T> From<T> for T

§

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
§

impl<T, U> Into<U> for T
where U: From<T>,

§

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> LoaderExtensions for T
where T: VersionInfo<LoaderType = Loader> + Send + Sync,

Source§

fn get_library<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_main_class<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_libraries<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_natives<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_java_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_assets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_complete<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_fabric_libraries<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_fabric_complete<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_quilt_libraries<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_quilt_complete<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_neoforge_complete<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

fn get_lighty_updater_complete<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<VersionMetaData>, QueryError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
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,

Source§

impl<T> MaybeSendSync for T