Struct App
pub struct App { /* private fields */ }Implementations§
§impl App
impl App
pub fn new(resources: Resources) -> Self
pub fn new(resources: Resources) -> Self
Creates a new standalone application with the given resources.
pub fn resources_mut(&mut self) -> &mut Resources
pub fn resources_mut(&mut self) -> &mut Resources
Returns a mutable reference to the application’s resources.
pub fn into_resources(self) -> 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>§
pub fn init_event<T>(&mut self) -> ResourceId<Events<T>>
pub fn init_meta<M, R>(&mut self)where
R: 'static,
M: AnyCastMut<R> + 'static + ?Sized,
pub fn init_meta_readonly<M, R>(&mut self)
pub fn init_meta_id<M, R>(&mut self, id: ResourceId<R>)where
R: 'static,
M: AnyCastMut<R> + 'static + ?Sized,
pub fn init_meta_readonly_id<M, R>(&mut self, id: ResourceId<R>)
pub fn foreach_meta<T>(&self, f: impl FnMut(&T))where
T: 'static + ?Sized,
pub fn foreach_meta_mut<T>(&self, f: impl FnMut(&mut T))where
T: 'static + ?Sized,
pub fn install<M>(&mut self, module: M) -> boolwhere
M: Module,
pub fn as_send(&self) -> &ResourcesSend
pub fn insert<T>(&mut self, value: T) -> ResourceId<T>
pub fn insert_box<T>(&mut self, value: Box<T>) -> ResourceId<T>
pub fn define<T>(&mut self) -> ResourceId<T>
pub fn insert_unsend<T>(&mut self, value: T) -> ResourceId<T>where
T: 'static,
pub fn insert_box_unsend<T>(&mut self, value: Box<T>) -> ResourceId<T>where
T: 'static,
pub fn define_unsend<T>(&mut self) -> ResourceId<T>where
T: 'static,
pub fn try_init<T>(&mut self) -> Result<ResourceId<T>, ResourceId<T>>
pub fn init<T>(&mut self) -> ResourceId<T>
pub fn try_init_unsend<T>(&mut self) -> Result<ResourceId<T>, ResourceId<T>>where
T: FromResourcesMut + 'static,
pub fn init_unsend<T>(&mut self) -> ResourceId<T>where
T: FromResourcesMut + 'static,
pub fn clear(&mut self)
pub fn borrow_res<T>(&self) -> Option<AtomicRef<'_, T>>where
T: 'static,
pub fn borrow_res_id<T>(
&self,
resource_id: ResourceId<T>,
) -> Option<AtomicRef<'_, T>>where
T: 'static,
pub fn borrow_res_mut<T>(&self) -> Option<AtomicRefMut<'_, T>>where
T: 'static,
pub fn borrow_res_mut_id<T>(
&self,
resource_id: ResourceId<T>,
) -> Option<AtomicRefMut<'_, T>>where
T: 'static,
pub fn get_mut<T>(&mut self) -> Option<&mut T>where
T: 'static,
pub fn get_mut_id<T>(&mut self, resource_id: ResourceId<T>) -> Option<&mut T>where
T: 'static,
pub fn get_copy<T>(&self) -> Option<T>where
T: Copy + 'static,
pub fn get_copy_id<T>(&self, resource_id: ResourceId<T>) -> Option<T>where
T: Copy + 'static,
pub fn get_clone<T>(&self) -> Option<T>where
T: Clone + 'static,
pub fn get_clone_id<T>(&self, resource_id: ResourceId<T>) -> Option<T>where
T: Clone + 'static,
pub fn take<T>(&mut self) -> Option<Taken<T>>where
T: 'static,
pub fn take_id<T>(&mut self, resource_id: ResourceId<T>) -> Option<Taken<T>>where
T: 'static,
pub fn put_back<T>(&mut self, taken: Taken<T>)where
T: 'static,
pub fn take_and<T, R>(
&mut self,
f: impl FnOnce(&mut T, &mut Resources) -> R,
) -> Option<R>where
T: 'static,
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,
pub fn borrow_res_meta<T>(
&self,
resource_id: ResourceId<T>,
) -> Option<AtomicRef<'_, T>>where
T: 'static + ?Sized,
pub fn borrow_res_any( &self, resource_id: ResourceId, ) -> Option<AtomicRef<'_, dyn Any + 'static>>
pub fn borrow_res_mut_meta<T>(
&self,
resource_id: ResourceId<T>,
) -> Option<AtomicRefMut<'_, T>>where
T: 'static + ?Sized,
pub fn borrow_res_any_mut( &self, resource_id: ResourceId, ) -> Option<AtomicRefMut<'_, dyn Any + 'static>>
pub fn get_mut_any( &mut self, resource_id: ResourceId, ) -> Option<&mut (dyn Any + 'static)>
pub fn run_schedule<S>(&mut self)
pub fn run_schedule_id<S>(&mut self, id: ResourceId<S>)
Methods from Deref<Target = ResourcesSend>§
Sourcepub unsafe fn as_unsend(&self) -> &Resources
pub unsafe fn as_unsend(&self) -> &Resources
§Safety
User must not access unsend resources in other threads.
pub fn id<T>(&self) -> Option<ResourceId<T>>where
T: 'static,
pub fn expect_id<T>(&self) -> ResourceId<T>where
T: 'static,
pub fn name<T>(&self, id: ResourceId<T>) -> Option<&str>
pub fn type_id<T>(&self, id: ResourceId<T>) -> Option<TypeId>
pub fn borrow_res<T>(&self) -> Option<AtomicRef<'_, T>>
pub fn borrow_res_id<T>( &self, resource_id: ResourceId<T>, ) -> Option<AtomicRef<'_, T>>
pub fn borrow_res_mut<T>(&self) -> Option<AtomicRefMut<'_, T>>
pub fn borrow_res_mut_id<T>( &self, resource_id: ResourceId<T>, ) -> Option<AtomicRefMut<'_, T>>
pub fn get_copy<T>(&self) -> Option<T>
pub fn get_copy_id<T>(&self, resource_id: ResourceId<T>) -> Option<T>
pub fn get_clone<T>(&self) -> Option<T>
pub fn get_clone_id<T>(&self, resource_id: ResourceId<T>) -> Option<T>
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more