Skip to main content

View

Struct View 

Source
pub struct View<'a> {
    pub dt: f32,
    pub elapsed: f32,
    pub vars: &'a [Val],
    pub locals: &'a [Val],
    pub bindings: &'a mut [Option<Val>],
    pub queries: &'a [Vec<Entity>],
    pub by_name: &'a dyn Fn(AssetId) -> Option<Entity>,
    pub transforms: &'a dyn Fn(Entity) -> Option<Transform>,
    pub alive: &'a dyn Fn(Entity) -> bool,
    pub self_entity: Option<Entity>,
    pub trace: &'a mut Option<Vec<u32>>,
}
Expand description

What a behavior may read this tick.

Fields§

§dt: f32

Seconds this tick advances.

§elapsed: f32

Seconds of simulated time so far.

§vars: &'a [Val]

The world’s variables, in slot order.

§locals: &'a [Val]

This instance’s locals, in slot order.

§bindings: &'a mut [Option<Val>]

Exactly as wide as the body’s binding high-water mark, so a slot is always in range and the frame never grows mid-run.

§queries: &'a [Vec<Entity>]

The entities each declared query selected this tick, in slot order.

§by_name: &'a dyn Fn(AssetId) -> Option<Entity>

Resolves a name to the entity carrying it.

§transforms: &'a dyn Fn(Entity) -> Option<Transform>

Reads an entity’s transform.

§alive: &'a dyn Fn(Entity) -> bool

Whether an entity still exists.

§self_entity: Option<Entity>

The entity this run is scoped to, if any.

§trace: &'a mut Option<Vec<u32>>

Node ids executed this run, recorded only while tracing is requested (None costs one branch per node).

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for View<'a>

§

impl<'a> !Send for View<'a>

§

impl<'a> !Sync for View<'a>

§

impl<'a> !UnwindSafe for View<'a>

§

impl<'a> Freeze for View<'a>

§

impl<'a> Unpin for View<'a>

§

impl<'a> UnsafeUnpin for View<'a>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.