pub struct AssetInfo {
pub hash: String,
pub size: usize,
}
Expand description
Information of a single asset.
Fields§
§hash: String
SHA1 of the asset file.
size: usize
Size of the asset file.
Implementations§
Source§impl AssetInfo
impl AssetInfo
Sourcepub fn asset_path(&self, assets_path: impl AsRef<Path>) -> PathBuf
pub fn asset_path(&self, assets_path: impl AsRef<Path>) -> PathBuf
Builds the complete path for the asset file.
Sourcepub fn relative_asset_path(&self) -> PathBuf
pub fn relative_asset_path(&self) -> PathBuf
Builds the path for the asset file relative to the assets folder.
Sourcepub fn resource_path(key: &str, minecraft_path: impl AsRef<Path>) -> PathBuf
pub fn resource_path(key: &str, minecraft_path: impl AsRef<Path>) -> PathBuf
Builds the complete path for the asset file mapped as a resource.
Sourcepub fn download_url(&self) -> String
pub fn download_url(&self) -> String
Builds the download URL for the asset.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AssetInfo
impl<'de> Deserialize<'de> for AssetInfo
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 AssetInfo
impl RefUnwindSafe for AssetInfo
impl Send for AssetInfo
impl Sync for AssetInfo
impl Unpin for AssetInfo
impl UnwindSafe for AssetInfo
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