pub enum ResourceKind {
BlockStates,
BlockModel,
ItemModel,
Texture,
TextureMeta,
}Expand description
The type of a resource.
Variants§
BlockStates
Resources (.json) in assets/<namespace>/blockstates/.
BlockModel
Resources (.json) in assets/<namespace>/models/block/.
ItemModel
Resources (.json) in assets/<namespace>/models/item/.
Texture
Resources (.png) in assets/<namespace>/textures/.
TextureMeta
Resources (.mcmeta) in assets/<namespace>/textures/.
Implementations§
Source§impl ResourceKind
impl ResourceKind
Sourcepub fn category(&self) -> ResourceCategory
pub fn category(&self) -> ResourceCategory
Returns the category of this resource type (assets or data).
Sourcepub fn extension(&self) -> &'static str
pub fn extension(&self) -> &'static str
Returns the file extension used for this resource’s file.
§Example
let kind = ResourceKind::BlockStates;
assert_eq!(kind.extension(), "json");
let kind = ResourceKind::Texture;
assert_eq!(kind.extension(), "png");
let kind = ResourceKind::TextureMeta;
assert_eq!(kind.extension(), "mcmeta");Trait Implementations§
Source§impl Clone for ResourceKind
impl Clone for ResourceKind
Source§fn clone(&self) -> ResourceKind
fn clone(&self) -> ResourceKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResourceKind
impl Debug for ResourceKind
Source§impl Hash for ResourceKind
impl Hash for ResourceKind
Source§impl PartialEq for ResourceKind
impl PartialEq for ResourceKind
impl Copy for ResourceKind
impl Eq for ResourceKind
impl StructuralPartialEq for ResourceKind
Auto Trait Implementations§
impl Freeze for ResourceKind
impl RefUnwindSafe for ResourceKind
impl Send for ResourceKind
impl Sync for ResourceKind
impl Unpin for ResourceKind
impl UnwindSafe for ResourceKind
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