App

Struct App 

pub struct App { /* private fields */ }

Implementations§

§

impl App

pub fn new(resources: Resources) -> Self

Creates a new standalone application with the given resources.

pub fn resources(&self) -> &Resources

Returns a reference to the application’s resources.

pub fn resources_mut(&mut self) -> &mut Resources

Returns a mutable reference to the application’s resources.

pub fn into_resources(self) -> Resources

returns the owned resources from the application.

pub fn should_exit(&self) -> Option<AppExit>

pub fn update(&mut self)

Methods from Deref<Target = Resources>§

Source

pub fn init_event<T>(&mut self) -> ResourceId<Events<T>>
where T: Send + Sync + 'static,

Source

pub fn init_meta<M, R>(&mut self)
where R: 'static, M: AnyCastMut<R> + 'static + ?Sized,

Source

pub fn init_meta_readonly<M, R>(&mut self)
where R: 'static, M: AnyCast<R> + 'static + ?Sized,

Source

pub fn init_meta_id<M, R>(&mut self, id: ResourceId<R>)
where R: 'static, M: AnyCastMut<R> + 'static + ?Sized,

Source

pub fn init_meta_readonly_id<M, R>(&mut self, id: ResourceId<R>)
where R: 'static, M: AnyCast<R> + 'static + ?Sized,

Source

pub fn foreach_meta<T>(&self, f: impl FnMut(&T))
where T: 'static + ?Sized,

Source

pub fn foreach_meta_mut<T>(&self, f: impl FnMut(&mut T))
where T: 'static + ?Sized,

Source

pub fn install<M>(&mut self, module: M) -> bool
where M: Module,

Source

pub fn as_send(&self) -> &ResourcesSend

Source

pub fn insert<T>(&mut self, value: T) -> ResourceId<T>
where T: Send + Sync + 'static,

Source

pub fn insert_box<T>(&mut self, value: Box<T>) -> ResourceId<T>
where T: Send + Sync + 'static,

Source

pub fn define<T>(&mut self) -> ResourceId<T>
where T: Send + Sync + 'static,

Source

pub fn insert_unsend<T>(&mut self, value: T) -> ResourceId<T>
where T: 'static,

Source

pub fn insert_box_unsend<T>(&mut self, value: Box<T>) -> ResourceId<T>
where T: 'static,

Source

pub fn define_unsend<T>(&mut self) -> ResourceId<T>
where T: 'static,

Source

pub fn try_init<T>(&mut self) -> Result<ResourceId<T>, ResourceId<T>>
where T: Send + Sync + FromResourcesMut + 'static,

Source

pub fn init<T>(&mut self) -> ResourceId<T>
where T: Send + Sync + FromResourcesMut + 'static,

Source

pub fn try_init_unsend<T>(&mut self) -> Result<ResourceId<T>, ResourceId<T>>
where T: FromResourcesMut + 'static,

Source

pub fn init_unsend<T>(&mut self) -> ResourceId<T>
where T: FromResourcesMut + 'static,

Source

pub fn clear(&mut self)

Source

pub fn borrow_res<T>(&self) -> Option<AtomicRef<'_, T>>
where T: 'static,

Source

pub fn borrow_res_id<T>( &self, resource_id: ResourceId<T>, ) -> Option<AtomicRef<'_, T>>
where T: 'static,

Source

pub fn borrow_res_mut<T>(&self) -> Option<AtomicRefMut<'_, T>>
where T: 'static,

Source

pub fn borrow_res_mut_id<T>( &self, resource_id: ResourceId<T>, ) -> Option<AtomicRefMut<'_, T>>
where T: 'static,

Source

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

Source

pub fn get_mut_id<T>(&mut self, resource_id: ResourceId<T>) -> Option<&mut T>
where T: 'static,

Source

pub fn get_copy<T>(&self) -> Option<T>
where T: Copy + 'static,

Source

pub fn get_copy_id<T>(&self, resource_id: ResourceId<T>) -> Option<T>
where T: Copy + 'static,

Source

pub fn get_clone<T>(&self) -> Option<T>
where T: Clone + 'static,

Source

pub fn get_clone_id<T>(&self, resource_id: ResourceId<T>) -> Option<T>
where T: Clone + 'static,

Source

pub fn take<T>(&mut self) -> Option<Taken<T>>
where T: 'static,

Source

pub fn take_id<T>(&mut self, resource_id: ResourceId<T>) -> Option<Taken<T>>
where T: 'static,

Source

pub fn put_back<T>(&mut self, taken: Taken<T>)
where T: 'static,

Source

pub fn take_and<T, R>( &mut self, f: impl FnOnce(&mut T, &mut Resources) -> R, ) -> Option<R>
where T: 'static,

Source

pub fn take_id_and<T, R>( &mut self, resource_id: ResourceId<T>, f: impl FnOnce(&mut T, &mut Resources) -> R, ) -> Option<R>
where T: 'static,

Source

pub fn borrow_res_meta<T>( &self, resource_id: ResourceId<T>, ) -> Option<AtomicRef<'_, T>>
where T: 'static + ?Sized,

Source

pub fn borrow_res_any( &self, resource_id: ResourceId, ) -> Option<AtomicRef<'_, dyn Any + 'static>>

Source

pub fn borrow_res_mut_meta<T>( &self, resource_id: ResourceId<T>, ) -> Option<AtomicRefMut<'_, T>>
where T: 'static + ?Sized,

Source

pub fn borrow_res_any_mut( &self, resource_id: ResourceId, ) -> Option<AtomicRefMut<'_, dyn Any + 'static>>

Source

pub fn get_mut_any( &mut self, resource_id: ResourceId, ) -> Option<&mut (dyn Any + 'static)>

Source

pub fn run_schedule<S>(&mut self)
where S: AsMut<Schedule> + 'static,

Source

pub fn run_schedule_id<S>(&mut self, id: ResourceId<S>)
where S: AsMut<Schedule> + 'static,

Methods from Deref<Target = ResourcesSend>§

Source

pub unsafe fn as_unsend(&self) -> &Resources

§Safety

User must not access unsend resources in other threads.

Source

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

Source

pub fn expect_id<T>(&self) -> ResourceId<T>
where T: 'static,

Source

pub fn name<T>(&self, id: ResourceId<T>) -> Option<&str>

Source

pub fn type_id<T>(&self, id: ResourceId<T>) -> Option<TypeId>

Source

pub fn borrow_res<T>(&self) -> Option<AtomicRef<'_, T>>
where T: Send + Sync + 'static,

Source

pub fn borrow_res_id<T>( &self, resource_id: ResourceId<T>, ) -> Option<AtomicRef<'_, T>>
where T: Send + Sync + 'static,

Source

pub fn borrow_res_mut<T>(&self) -> Option<AtomicRefMut<'_, T>>
where T: Send + Sync + 'static,

Source

pub fn borrow_res_mut_id<T>( &self, resource_id: ResourceId<T>, ) -> Option<AtomicRefMut<'_, T>>
where T: Send + Sync + 'static,

Source

pub fn get_copy<T>(&self) -> Option<T>
where T: Copy + Send + Sync + 'static,

Source

pub fn get_copy_id<T>(&self, resource_id: ResourceId<T>) -> Option<T>
where T: Copy + Send + Sync + 'static,

Source

pub fn get_clone<T>(&self) -> Option<T>
where T: Clone + Send + Sync + 'static,

Source

pub fn get_clone_id<T>(&self, resource_id: ResourceId<T>) -> Option<T>
where T: Clone + Send + Sync + 'static,

Trait Implementations§

§

impl Deref for App

§

type Target = Resources

The resulting type after dereferencing.
§

fn deref(&self) -> &Self::Target

Dereferences the value.
§

impl DerefMut for App

§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
§

impl From<App> for Resources

§

fn from(app: App) -> Self

Converts to this type from the input type.
§

impl From<Resources> for App

§

fn from(resources: Resources) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for App

§

impl !RefUnwindSafe for App

§

impl !Send for App

§

impl !Sync for App

§

impl Unpin for App

§

impl !UnwindSafe for App

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more