pub struct Mod { /* private fields */ }
Expand description
模组文件数据
可通过 crate::version::structs::VersionInfo::get_mods
获取
Implementations§
source§impl Mod
impl Mod
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
模组是否已经启用(既是否以 .jar.disabled
结尾)
sourcepub async fn display_name(&self) -> String
pub async fn display_name(&self) -> String
尝试获取一个可供显示的模组名称
sourcepub async fn try_get_mod_meta(&self) -> Result<ModMeta>
pub async fn try_get_mod_meta(&self) -> Result<ModMeta>
尝试获取模组的元数据信息
sourcepub async fn try_get_mod_name(&self) -> Result<String>
pub async fn try_get_mod_name(&self) -> Result<String>
Mod::try_get_mod_meta
的语法糖,尝试根据模组元数据获取模组名称
sourcepub async fn try_get_mod_icon(&self) -> Result<DynamicImage>
pub async fn try_get_mod_icon(&self) -> Result<DynamicImage>
Mod::try_get_mod_meta
的语法糖,尝试根据模组元数据获取模组的其中一个图标
sourcepub async fn enable(&mut self) -> Result<()>
pub async fn enable(&mut self) -> Result<()>
如果模组是禁用的(既以 .jar.disabled
结尾),启用该模组(既还原成 .jar
结尾)
如果重命名失败则会返回错误
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Mod
impl Send for Mod
impl Sync for Mod
impl Unpin for Mod
impl UnwindSafe for Mod
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