Struct cobble_core::minecraft::models::Library
source · 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