pub struct Library {
pub downloads: LibraryDownloads,
pub name: String,
pub natives: Option<LibraryNatives>,
pub rules: Vec<Rule>,
pub extract: Option<LibraryExtract>,
}
Expand description
A library need for running the game.
Fields§
§downloads: LibraryDownloads
Information about downloading the library.
name: String
Name of the library.
natives: Option<LibraryNatives>
Available natives.
rules: Vec<Rule>
Rules for using this library.
extract: Option<LibraryExtract>
Extract options.
Implementations§
Source§impl Library
impl Library
Sourcepub fn library_path(&self, libraries_path: impl AsRef<Path>) -> PathBuf
pub fn library_path(&self, libraries_path: impl AsRef<Path>) -> PathBuf
Builds the path where the library jar file is placed. This path does not include the file itself.
Sourcepub fn relative_library_path(&self) -> PathBuf
pub fn relative_library_path(&self) -> PathBuf
Builds the path where the library jar file is placed relative to the libraries folder. This path does not include the file itself.
Sourcepub fn jar_path(&self, libraries_path: impl AsRef<Path>) -> PathBuf
pub fn jar_path(&self, libraries_path: impl AsRef<Path>) -> PathBuf
Builds the complete path for the library jar file relat.
Sourcepub fn relative_jar_path(&self) -> PathBuf
pub fn relative_jar_path(&self) -> PathBuf
Builds the complete path for the library jar file relative to the libraries folder.
Sourcepub fn download_url(&self) -> (String, Option<String>, Option<usize>)
pub fn download_url(&self) -> (String, Option<String>, Option<usize>)
Builds the download URL for the library. Returns a tuble: (URL, SHA1, size).
Sourcepub fn needs_extract(&self) -> bool
pub fn needs_extract(&self) -> bool
Checks if the library needs to be extracted.
Sourcepub fn get_native(&self) -> Option<String>
pub fn get_native(&self) -> Option<String>
Gets the native identifier of the library.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Library
impl<'de> Deserialize<'de> for Library
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Library
impl RefUnwindSafe for Library
impl Send for Library
impl Sync for Library
impl Unpin for Library
impl UnwindSafe for Library
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
Mutably borrows from an owned value. Read more