pub struct Bundle<const RESOURCE_TYPE: ResourceType, const AMOUNT: u32> { /* private fields */ }Expand description
Contains a fixed (compile-time known) amount of a resource.
A Bundle can be used to build structures or as input for recipes.
Implementations§
Source§impl<const RESOURCE_TYPE: ResourceType, const AMOUNT: u32> Bundle<RESOURCE_TYPE, AMOUNT>
impl<const RESOURCE_TYPE: ResourceType, const AMOUNT: u32> Bundle<RESOURCE_TYPE, AMOUNT>
pub fn resource_type(&self) -> ResourceType
pub fn amount(&self) -> u32
Sourcepub fn to_resource(self) -> Resource<RESOURCE_TYPE>
pub fn to_resource(self) -> Resource<RESOURCE_TYPE>
Trait Implementations§
Source§impl<const RESOURCE_TYPE: ResourceType, const AMOUNT: u32> Add<Bundle<RESOURCE_TYPE, AMOUNT>> for Resource<RESOURCE_TYPE>
impl<const RESOURCE_TYPE: ResourceType, const AMOUNT: u32> Add<Bundle<RESOURCE_TYPE, AMOUNT>> for Resource<RESOURCE_TYPE>
Source§impl<const RESOURCE_TYPE: ResourceType, const AMOUNT_LHS: u32, const AMOUNT_RHS: u32> Add<Bundle<RESOURCE_TYPE, AMOUNT_RHS>> for Bundle<RESOURCE_TYPE, AMOUNT_LHS>
impl<const RESOURCE_TYPE: ResourceType, const AMOUNT_LHS: u32, const AMOUNT_RHS: u32> Add<Bundle<RESOURCE_TYPE, AMOUNT_RHS>> for Bundle<RESOURCE_TYPE, AMOUNT_LHS>
Auto Trait Implementations§
impl<const RESOURCE_TYPE: ResourceType, const AMOUNT: u32> Freeze for Bundle<RESOURCE_TYPE, AMOUNT>
impl<const RESOURCE_TYPE: ResourceType, const AMOUNT: u32> RefUnwindSafe for Bundle<RESOURCE_TYPE, AMOUNT>
impl<const RESOURCE_TYPE: ResourceType, const AMOUNT: u32> Send for Bundle<RESOURCE_TYPE, AMOUNT>
impl<const RESOURCE_TYPE: ResourceType, const AMOUNT: u32> Sync for Bundle<RESOURCE_TYPE, AMOUNT>
impl<const RESOURCE_TYPE: ResourceType, const AMOUNT: u32> Unpin for Bundle<RESOURCE_TYPE, AMOUNT>
impl<const RESOURCE_TYPE: ResourceType, const AMOUNT: u32> UnwindSafe for Bundle<RESOURCE_TYPE, AMOUNT>
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