Skip to main content

Event

Enum Event 

Source
#[non_exhaustive]
pub enum Event<'a> {
Show 31 variants FilterFeatures { features: &'a mut HashSet<String>, }, LoadedFeatures { features: &'a HashSet<String>, }, LoadHierarchy { root_version: &'a str, }, LoadedHierarchy { hierarchy: &'a [LoadedVersion], }, LoadVersion { version: &'a str, file: &'a Path, }, NeedVersion { version: &'a str, file: &'a Path, retry: &'a mut bool, }, LoadedVersion { version: &'a str, file: &'a Path, }, LoadClient, LoadedClient { file: &'a Path, }, LoadLibraries, FilterLibraries { libraries: &'a mut Vec<LoadedLibrary>, }, LoadedLibraries { libraries: &'a [LoadedLibrary], }, FilterLibrariesFiles { class_files: &'a mut Vec<PathBuf>, natives_files: &'a mut Vec<PathBuf>, }, LoadedLibrariesFiles { class_files: &'a [PathBuf], natives_files: &'a [PathBuf], }, NoLogger, LoadLogger { id: &'a str, }, LoadedLogger { id: &'a str, }, NoAssets, LoadAssets { id: &'a str, }, LoadedAssets { id: &'a str, count: usize, }, VerifiedAssets { id: &'a str, count: usize, }, LoadJvm { major_version: u32, }, FoundJvmSystemVersion { file: &'a Path, version: &'a str, compatible: bool, }, WarnJvmUnsupportedDynamicCrt, WarnJvmUnsupportedPlatform, WarnJvmMissingDistribution, LoadedJvm { file: &'a Path, version: Option<&'a str>, compatible: bool, }, DownloadResources { cancel: &'a mut bool, }, DownloadedResources, DownloadProgress { count: u32, total_count: u32, size: u32, total_size: u32, }, ExtractedBinaries { dir: &'a Path, },
}
Expand description

Events happening when installing.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

FilterFeatures

Filter the features that will be later used to filter rules using them.

Fields

§features: &'a mut HashSet<String>
§

LoadedFeatures

Notification of all features that have been selected after filtering.

Fields

§features: &'a HashSet<String>
§

LoadHierarchy

The version hierarchy will be loaded, starting from the given root version.

Fields

§root_version: &'a str
§

LoadedHierarchy

The given version hierarchy has been successfully loaded.

Fields

§hierarchy: &'a [LoadedVersion]
§

LoadVersion

A version will be loaded, at this point you can check the file for its validity, and delete it if relevant, in this case Self::NeedVersion is called just after to possibly install the version metadata.

Fields

§version: &'a str
§file: &'a Path
§

NeedVersion

This event is called if the given version is missing a metadata file, in this case its path is given and this handler has the possibility of installing it before retrying. If the handler actually wants the loading to be retried after it as handled it, it should return true.

Fields

§version: &'a str
§file: &'a Path
§retry: &'a mut bool
§

LoadedVersion

The given version in the hierarchy has been successfully loaded, the metadata file path is also given.

Fields

§version: &'a str
§file: &'a Path
§

LoadClient

The client JAR file will be loaded.

§

LoadedClient

The client JAR file has been loaded successfully at the given path.

Fields

§file: &'a Path
§

LoadLibraries

The game required libraries are going to be loaded.

§

FilterLibraries

Filter versions before their verification.

Fields

§libraries: &'a mut Vec<LoadedLibrary>
§

LoadedLibraries

Libraries have been loaded. After that, the libraries will be verified and added to the downloads list if missing.

Fields

§libraries: &'a [LoadedLibrary]
§

FilterLibrariesFiles

Libraries have been verified. Note that all paths will be canonicalized, relatively to the current process’ working dir, before being added to the command line, so the files must exists.

Fields

§class_files: &'a mut Vec<PathBuf>
§natives_files: &'a mut Vec<PathBuf>
§

LoadedLibrariesFiles

The final version of class and natives files has been loaded.

Fields

§class_files: &'a [PathBuf]
§natives_files: &'a [PathBuf]
§

NoLogger

No logger configuration will be loaded because version doesn’t specify any.

§

LoadLogger

The logger configuration will be loaded.

Fields

§id: &'a str
§

LoadedLogger

Logger configuration has been loaded successfully.

Fields

§id: &'a str
§

NoAssets

Assets will not be loaded because version doesn’t specify any.

§

LoadAssets

Assets will be loaded.

Fields

§id: &'a str
§

LoadedAssets

Assets have been loaded, and are going to be verified in order to add missing ones to the download batch.

Fields

§id: &'a str
§count: usize
§

VerifiedAssets

Assets have been verified and missing assets have been added to the download batch.

Fields

§id: &'a str
§count: usize
§

LoadJvm

The JVM will be loaded, depending on the policy configured in the installer. The major version that is required is given, when not specified by any version metadata it defaults to Java 8, because most older versions didn’t specify it.

Fields

§major_version: u32
§

FoundJvmSystemVersion

When searching for JVMs in the system standard paths, this event trigger for each detected JVM executable, and indicates if this version is compatible and therefore is a potential candidate for being used as the JVM.

Fields

§file: &'a Path
§version: &'a str
§compatible: bool
§

WarnJvmUnsupportedDynamicCrt

The system runs on Linux and has C runtime not dynamically linked (static, musl for example), suggesting that your system doesn’t provide dynamic C runtime (glibc), and such JVM are not provided by Mojang.

§

WarnJvmUnsupportedPlatform

When trying to find a Mojang JVM to install, your operating system and architecture are not supported.

§

WarnJvmMissingDistribution

When trying to find a Mojang JVM to install, your operating system and architecture are supported but the distribution (the java version packaged and distributed by Mojang) is not found.

§

LoadedJvm

The JVM has been loaded, if the version is known. The compatible flag indicates if this JVM is likely compatible with the game version, when false it indicates that it will likely be incompatible.

Fields

§file: &'a Path
§version: Option<&'a str>
§compatible: bool
§

DownloadResources

Resources will be downloaded. This function returns a boolean that indicates if the download should proceed, this can be used to abort

Fields

§cancel: &'a mut bool
§

DownloadedResources

Resources have been successfully downloaded.

§

DownloadProgress

A download progress forwarded from a download handler.

Fields

§count: u32
§total_count: u32
§size: u32
§total_size: u32
§

ExtractedBinaries

All binaries has been successfully extracted to the given binary directory.

Fields

§dir: &'a Path

Trait Implementations§

Source§

impl<'a> Debug for Event<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for Event<'a>

§

impl<'a> Freeze for Event<'a>

§

impl<'a> RefUnwindSafe for Event<'a>

§

impl<'a> Send for Event<'a>

§

impl<'a> Sync for Event<'a>

§

impl<'a> Unpin for Event<'a>

§

impl<'a> UnsafeUnpin for Event<'a>

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> 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + 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: Sized + 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
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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