Skip to main content

WorldRef

Struct WorldRef 

Source
pub struct WorldRef<'world> { /* private fields */ }

Implementations§

Source§

impl<'world> WorldRef<'world>

Source

pub fn as_raw(&self) -> *const WorldRaw

Source

pub fn as_raw_mut(&self) -> *mut WorldRaw

Source

pub fn entity(&self) -> Entity

Source

pub fn is_alive(&self, entity: Entity) -> bool

Source

pub fn is(&self, entity: Entity, target: Entity) -> bool

Source

pub fn is_a(&self, entity: Entity, base: Entity)

Source

pub fn kill(&self, entity: Entity)

Source

pub fn add<T: Component>(&self, entity: Entity)

Source

pub fn remove<T: Component>(&self, entity: Entity)

Source

pub fn has<T: Component>(&self, entity: Entity) -> bool

Source

pub fn has_owned<T: Component>(&self, entity: Entity) -> bool

Source

pub fn set<T: Component>(&self, entity: Entity, value: T)

Source

pub fn get<T: Component>(&self, entity: Entity) -> Option<&'world T>

Source

pub fn get_mut<T: Component>(&self, entity: Entity) -> Option<&'world mut T>

Source

pub fn disable(&self, entity: Entity)

Source

pub fn enable(&self, entity: Entity)

Source

pub fn is_disabled(&self, entity: Entity) -> bool

Source

pub fn is_enabled(&self, entity: Entity) -> bool

Source

pub fn child_of(&self, entity: Entity, parent: Entity)

Source

pub fn parent(&self, entity: Entity) -> Option<Entity>

Source

pub fn set_name(&self, entity: Entity, name: &str)

Source

pub fn name(&self, entity: Entity) -> Option<&'world str>

Source

pub fn set_resource<T: Resource>(&self, value: T)

Source

pub fn resource<T: Resource>(&self) -> &'world T

Source

pub fn resource_mut<T: Resource>(&self) -> &'world mut T

Source

pub fn try_resource<T: Resource>(&self) -> Option<&'world T>

Source

pub fn try_resource_mut<T: Resource>(&self) -> Option<&'world mut T>

Source

pub fn has_resource<T: Resource>(&self) -> bool

Source

pub fn remove_resource<T: Resource>(&self)

Source

pub fn event<E: Event>(&self) -> EventId

Source

pub unsafe fn trigger_raw<T>(&self, entity: Entity, event: EventId, value: &T)

Source

pub fn trigger<E>(&self, entity: Entity, value: E)
where E: Event<Payload = E>,

Source

pub fn trigger_ref<E: Event>(&self, entity: Entity, value: &E::Payload)

Trait Implementations§

Source§

impl<'world> Clone for WorldRef<'world>

Source§

fn clone(&self) -> WorldRef<'world>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'world> Copy for WorldRef<'world>

Auto Trait Implementations§

§

impl<'world> !Send for WorldRef<'world>

§

impl<'world> !Sync for WorldRef<'world>

§

impl<'world> !UnwindSafe for WorldRef<'world>

§

impl<'world> Freeze for WorldRef<'world>

§

impl<'world> RefUnwindSafe for WorldRef<'world>

§

impl<'world> Unpin for WorldRef<'world>

§

impl<'world> UnsafeUnpin for WorldRef<'world>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.