pub struct Universe {
    pub paused_systems_execution: bool,
    /* private fields */
}

Fields§

§paused_systems_execution: bool

Implementations§

source§

impl Universe

source

pub fn new<S>(state: S) -> Selfwhere S: State + 'static,

source

pub fn world(&self) -> RwLockReadGuard<'_, World>

source

pub fn world_mut(&self) -> RwLockWriteGuard<'_, World>

source

pub fn try_world(&self) -> Option<RwLockReadGuard<'_, World>>

source

pub fn try_world_mut(&self) -> Option<RwLockWriteGuard<'_, World>>

source

pub fn insert_resource<T>(&mut self, resource: T)where T: 'static + Send + Sync,

source

pub unsafe fn insert_resource_raw( &mut self, as_type: TypeId, resource: Box<Resource> )

Safety

This function assume that as_type matches exactly the type of resource, you can call it for example if you want to move already prepared resources from another place to this universe (in this case we can be sure type IDs matches the types of resources).

source

pub fn remove_resource<T>(&mut self)where T: 'static,

source

pub fn has_resource<T>(&self) -> boolwhere T: 'static,

source

pub fn resource<T>(&self) -> Option<ResRead<T>>where T: 'static,

source

pub fn resource_mut<T>(&self) -> Option<ResWrite<T>>where T: 'static,

source

pub fn expect_resource<T>(&self) -> ResRead<T>where T: 'static,

source

pub fn expect_resource_mut<T>(&self) -> ResWrite<T>where T: 'static,

source

pub fn query_resources<T>(&self) -> T::Fetchwhere T: ResQuery,

source

pub fn is_running(&self) -> bool

source

pub fn maintain(&mut self)

Trait Implementations§

source§

impl Default for Universe

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Finalize for T

§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Initialize for Twhere T: Default,

§

fn initialize(&mut self)

§

unsafe fn initialize_raw(data: *mut ())

Safety Read more
source§

impl<T, U> Into<U> for Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> Component for Twhere T: Send + Sync + 'static,