Struct ScopedActionResult
#[non_exhaustive]pub struct ScopedActionResult {
pub outcome: ActionOutcome,
pub held: Option<ItemStack>,
pub other: Vec<ItemStack>,
}Expand description
A scoped action’s result. The returned stacks belong to the caller, not to the fake’s restored inventory. World changes and normal action hooks have already run.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.outcome: ActionOutcomeWhat the existing player action path did, including a stopped fake-player effect.
held: Option<ItemStack>The remaining main-hand stack, if nonempty.
other: Vec<ItemStack>Other nonempty inventory stacks, then offhand, carried stack and armor, in that order.
Implementations§
§impl ScopedActionResult
impl ScopedActionResult
pub fn new(
outcome: ActionOutcome,
held: Option<ItemStack>,
other: Vec<ItemStack>,
) -> ScopedActionResult
pub fn new( outcome: ActionOutcome, held: Option<ItemStack>, other: Vec<ItemStack>, ) -> ScopedActionResult
The outcome and inventory returned by a scoped action.
Trait Implementations§
§impl Clone for ScopedActionResult
impl Clone for ScopedActionResult
§fn clone(&self) -> ScopedActionResult
fn clone(&self) -> ScopedActionResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ScopedActionResult
impl Debug for ScopedActionResult
§impl PartialEq for ScopedActionResult
impl PartialEq for ScopedActionResult
impl StructuralPartialEq for ScopedActionResult
Auto Trait Implementations§
impl Freeze for ScopedActionResult
impl RefUnwindSafe for ScopedActionResult
impl Send for ScopedActionResult
impl Sync for ScopedActionResult
impl Unpin for ScopedActionResult
impl UnsafeUnpin for ScopedActionResult
impl UnwindSafe for ScopedActionResult
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