pub struct RenderCx<'a, 'ctx> { /* private fields */ }Implementations§
Source§impl<'a, 'ctx> RenderCx<'a, 'ctx>
impl<'a, 'ctx> RenderCx<'a, 'ctx>
pub fn new(scope: &UiScope, context: &'ctx UiRenderContext<'a>) -> Self
pub fn node_id(&self) -> UiId
pub fn viewport(&self) -> UiRect
pub fn application(&mut self) -> ApplicationContext
pub fn command<C>(&mut self) -> CommandHandle<C>where
C: Command,
pub fn use_event<E>(
&mut self,
deps: impl Clone + PartialEq + 'static,
handler: impl Fn(E) + Send + Sync + 'static,
)where
E: Event,
pub fn use_event_once<E>(&mut self, handler: impl Fn(E) + Send + Sync + 'static)where
E: Event,
pub fn use_event_async<E>(
&mut self,
deps: impl Clone + PartialEq + 'static,
handler: impl AsyncEventHandler<E>,
)where
E: Event,
pub fn use_event_async_once<E>(&mut self, handler: impl AsyncEventHandler<E>)where
E: Event,
Sourcepub fn listen<T>(
&mut self,
key: EventKey<T>,
listener: impl Fn(T) + Send + Sync + 'static,
)
pub fn listen<T>( &mut self, key: EventKey<T>, listener: impl Fn(T) + Send + Sync + 'static, )
Listens for a typed Event key for this component’s mounted lifetime.
The listener is installed only after a successful present and is automatically removed when this component unmounts or the key changes.
Sourcepub fn listen_with<T, D>(
&mut self,
key: EventKey<T>,
deps: D,
listener: impl Fn(T) + Send + Sync + 'static,
)
pub fn listen_with<T, D>( &mut self, key: EventKey<T>, deps: D, listener: impl Fn(T) + Send + Sync + 'static, )
Listens for a typed Event key and replaces the listener when deps
changes.
Sourcepub fn listen_async<T, F, Fut>(&mut self, key: EventKey<T>, listener: F)
pub fn listen_async<T, F, Fut>(&mut self, key: EventKey<T>, listener: F)
Listens for a typed Event key and schedules each callback Future on the Application executor.
Sourcepub fn listen_async_with<T, D, F, Fut>(
&mut self,
key: EventKey<T>,
deps: D,
listener: F,
)
pub fn listen_async_with<T, D, F, Fut>( &mut self, key: EventKey<T>, deps: D, listener: F, )
Asynchronously listens for a typed Event key and replaces the listener
when deps changes.
pub fn use_state<T>( &mut self, initial: impl FnOnce() -> T, ) -> (T, StateSetter<T>)
pub fn use_state_eq<T>( &mut self, initial: impl FnOnce() -> T, ) -> (T, StateSetter<T>)
pub fn state<T>(&mut self, initial: T) -> State<T>
pub fn state_with<T>(&mut self, initial: impl FnOnce() -> T) -> State<T>
pub fn use_component_state<T, R>( &mut self, update: impl FnOnce(&mut T) -> R, ) -> R
pub fn use_effect<D, F, R>(&mut self, deps: D, effect: F)
pub fn use_effect_once<F>(&mut self, effect: F)where
F: FnOnce() + 'static,
pub fn use_mount<F>(&mut self, effect: F)where
F: FnOnce() + 'static,
pub fn use_context<T>(&mut self) -> Twhere
T: Clone + 'static,
pub fn try_use_context<T>(&mut self) -> Option<T>where
T: Clone + 'static,
pub fn use_observable<T, S, F>( &mut self, source: Observable<T>, selector: F, ) -> S
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'ctx> !RefUnwindSafe for RenderCx<'a, 'ctx>
impl<'a, 'ctx> !Send for RenderCx<'a, 'ctx>
impl<'a, 'ctx> !Sync for RenderCx<'a, 'ctx>
impl<'a, 'ctx> !UnwindSafe for RenderCx<'a, 'ctx>
impl<'a, 'ctx> Freeze for RenderCx<'a, 'ctx>
impl<'a, 'ctx> Unpin for RenderCx<'a, 'ctx>
impl<'a, 'ctx> UnsafeUnpin for RenderCx<'a, 'ctx>
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