pub struct Library {
pub rules: Vec<ApplyRule>,
pub downloads: Option<LibraryDownload>,
pub url: Option<String>,
pub natives: Option<BTreeMap<String, String>>,
pub name: String,
}
Expand description
一个依赖库结构
通过访问 Library::rules
并调用 Allowed::is_allowed
来确认此依赖是否需要被下载/添加
Fields§
§rules: Vec<ApplyRule>
添加这个依赖库需要满足的规则
downloads: Option<LibraryDownload>
需要下载的依赖库项目
url: Option<String>
旧版本的依赖下载链接,常见于一些模组加载器里
natives: Option<BTreeMap<String, String>>
旧版本的依赖原生库项目,新版本将直接把原生库放在了 Library::downloads
项目里直接作为 Class Path 的一部分导入了。
name: String
这个依赖库的名称,通常是包名和版本号
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
source§impl PartialEq<Library> for Library
impl PartialEq<Library> for Library
impl Eq for Library
impl StructuralEq for Library
impl StructuralPartialEq for Library
Auto Trait Implementations§
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.