Trait FromWorld

pub trait FromWorld {
    // Required method
    fn from_world(world: &mut World) -> Self;
}
Expand description

Creates an instance of the type this trait is implemented for using data from the supplied World.

This can be helpful for complex initialization or context-aware defaults.

Required Methods§

fn from_world(world: &mut World) -> Self

Creates Self using data from the given World.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl FromWorld for Children

§

fn from_world(_world: &mut World) -> Children

§

impl FromWorld for Parent

§

fn from_world(_world: &mut World) -> Parent

Implementors§

§

impl FromWorld for WorldId

§

impl<D, F> FromWorld for QueryState<D, F>
where D: QueryData, F: QueryFilter,

§

impl<Param> FromWorld for SystemState<Param>
where Param: SystemParam,

§

impl<T> FromWorld for T
where T: Default,