pub struct Held;Expand description
Marks an entity currently being carried by the player.
Runtime-only zero-size tag, added and removed by the physics system on pickup and drop. While present, the entity is driven as a kinematic body that follows the camera instead of simulating dynamically.
Trait Implementations§
Source§impl Component for Held
impl Component for Held
Source§fn from_baked(_bytes: &[u8]) -> Result<Self, CnResult>
fn from_baked(_bytes: &[u8]) -> Result<Self, CnResult>
Reconstruct this component from a blob record, whose bytes are the
serialized runtime component (cook already ran the asset -> component
translation). The default rejects: runtime-only components are never
stored in a blob, so only loadable types provide an implementation.
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Called after construction to inject the payload locator from the blob def.
Only meaningful for components with a compiled payload.
The default implementation does nothing (correct for most components).
Source§fn inject_name(&mut self, _id: AssetId)
fn inject_name(&mut self, _id: AssetId)
Called after construction to inject the asset’s identity from the blob
def. Only meaningful for components that look themselves up by id at
runtime. The default implementation does nothing.
Source§impl ComponentSlot for Held
impl ComponentSlot for Held
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
The component type’s stable id, used as its
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<Self>
fn slot(s: &ComponentStorage) -> &Column<Self>
Borrow this type’s column out of the storage.
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
Mutably borrow this type’s column out of the storage.
impl Copy for Held
Source§impl From<Held> for ComponentAsset
impl From<Held> for ComponentAsset
impl RuntimeComponent for Held
Auto Trait Implementations§
impl Freeze for Held
impl RefUnwindSafe for Held
impl Send for Held
impl Sync for Held
impl Unpin for Held
impl UnsafeUnpin for Held
impl UnwindSafe for Held
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