pub struct CraftPreview { /* private fields */ }Expand description
Implementations§
Source§impl CraftPreview
impl CraftPreview
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Whether the entire recipe, including its outputs, can be crafted.
Sourcepub fn result(&self) -> Result<(), LoopError>
pub fn result(&self) -> Result<(), LoopError>
The exact result craft would return for the previewed inventory.
Error ordering is unchanged: recipe lengths first, then input removals in order, then output additions in order. A later invalid entry can be masked by an earlier unavailable input or full output stack.
Sourcepub fn missing_ingredients(&self) -> &[MissingIngredient]
pub fn missing_ingredients(&self) -> &[MissingIngredient]
Every input shortfall, in first-appearance order, with duplicates summed.
For recipe lengths within 1..=32, this describes all input costs even
if another entry is invalid. Zero costs contribute nothing. Out-of-range
recipe lengths yield an empty slice and LoopError::Invalid.
An empty slice alone does not imply availability: outputs must also fit.
Trait Implementations§
Source§impl Clone for CraftPreview
impl Clone for CraftPreview
Source§fn clone(&self) -> CraftPreview
fn clone(&self) -> CraftPreview
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 CraftPreview
impl Debug for CraftPreview
Source§impl PartialEq for CraftPreview
impl PartialEq for CraftPreview
impl Eq for CraftPreview
impl StructuralPartialEq for CraftPreview
Auto Trait Implementations§
impl Freeze for CraftPreview
impl RefUnwindSafe for CraftPreview
impl Send for CraftPreview
impl Sync for CraftPreview
impl Unpin for CraftPreview
impl UnwindSafe for CraftPreview
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